Export database from MongoDb atlas to the local machine Monogo compass

Farbod Aprin picture Farbod Aprin · Jan 16, 2020 · Viewed 8k times · Source

I have remote database in Atlas with name of "test" and I want to download collection name image_table as a JSON file.

In mac terminal:

$ mongoexport –db test –collection image_table image.json I got the error>

020-01-16T13:49:12.822+0100 error parsing command line options: too many positional arguments: [–db test –collection image_table image.json] 2020-01-16T13:49:12.822+0100 try 'mongoexport --help' for more information

Answer

Farbod Aprin picture Farbod Aprin · Jan 16, 2020

I could find a bit more straightforward answer in Mongo Compass :

enter image description here

Just install mongo compass connect to your atlas remote DB: get the hostname like "cluster0-shard-00-00-rcapo.mongodb.net XXXXX" from your remote altas cluster then connect to the database.

then you can download each document as JSON or CSV format. thanks, mongo DB compass developers team.