Import data with Object ID

125 views
Skip to first unread message

Apple Santiago

unread,
Jan 4, 2017, 3:43:48 PM1/4/17
to mongodb-user
im trying to use mongoimport in uploading massive data. but i'm having an error in ObjectIds data. how to import csv file with ObjectID fields?

Kevin Adistambha

unread,
Jan 24, 2017, 11:12:17 PM1/24/17
to mongodb-user

Hi

im trying to use mongoimport in uploading massive data. but i’m having an error in ObjectIds data. how to import csv file with ObjectID fields?

It’s been a while since you’ve posted this question. Have you managed to find a solution?

Unfortunately, CSV data doesn’t carry any type information such as NumberInt, NumberLong, etc. which also includes ObjectId. Hence mongoexport and mongoimport cannot recognize any type information if filetype is set to CSV.

If applicable, you may be able to convert your data into Extended JSON, with special notations to denote type information. Using this format would allow you to be specific about the datatype you’re inserting.

Best regards,
Kevin

Reply all
Reply to author
Forward
0 new messages