Mongodb Compass export to CSV from command line

Hello

I have been using the export feature in mongodb compass and it works great for my requirements, but is there a way to get it to run from command line with my selections and filters so it could be run on an automated schedule without my input? Or if not possible from Compass, what other automated client-side options do I have to export the data in CSV form?

mongoexport is part of the MongoDB database tools and can export with a query parameter.

See the usage documentation for further details and examples.

ref:
https://www.mongodb.com/try/download/database-tools
https://www.mongodb.com/docs/database-tools/mongoexport/

3 Likes

Oops, @chris is right … I deleted my response … I never noticed mongoexport before :face_with_open_eyes_and_hand_over_mouth:

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.