How to convert MongoDB archive file to JSON format?
mongoexport
I believe the only way is from the database, using mongoexport
:
mongoexport --db yourdb -c yourCollection --out yourCollection.json
warning from mongo
Just take notice of the following (from their website):
WARNING
Avoid using mongoimport and mongoexport for full instance production backups. They do not reliably preserve all rich BSON data types, because JSON can only represent a subset of the types supported by BSON. Use mongodump and mongorestore as described in MongoDB Backup Methods for this kind of functionality.