Questions on Export features

Ervs Sevilla shared this question 6 years ago
Answered

I'm not sure why the export to "JSON" file contains "BINARY" data format for the _id and

exporting to "SQL" file contains GUID string for the _id.

See, the reason for exporting these datasets from MongoDB is to use it somewhere else correct?

So, exporting to JSON file should have the _id as GUID or at least provide an option there.

/0guSkEwQPkfeSubhgUb0Yvv7LUmlQEL2EytIXpYvKyeCV2XwslrDMGIxzzIlubvvFdcF8YpjHwX7CtJqxDF7N9q0zVnVN+

Replies (2)

photo
1

If you choose export as "mongoexport json (*.json)" , it will format LUUID as {"$binary":"xxxxxxxxxxxxxxxxxx==","$type":"03"} to follow MongoDB Specification.

To properly parse and import to MongoDB, the "mongoexport" JSON format needs to retain type information. If the UUID is formatted as a simple UUID string, when you import the JSON file into MongoDB, it becomes a string instead of a real UUID value.

photo
1

Thank you for your response. I appreciate it!

Maybe in the near future, you guys will provide an option to export collections to JSON file with UUID string.

I was playing with MS SQL's JSON import where I have a JSON file and import it - straight up to SQL Server with no data conversions.

Leave a Comment
 
Attach a file