jsonmongodbmongodb-atlasmongodb-compassmongoexport

Export database from MongoDb atlas to the local machine Monogo compass


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


Solution

  • 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.