Reputation: 1286
In MySQL I can do select * from some_table into outfile 'myfile.csv'
Is there something similar in MongoDB? Cannot find relevant information in the documenatation. I'm working with mongodb 2.2.3.
Upvotes: 0
Views: 34
Reputation: 216
You might want to use mongoexport
, which produces a JSON or CSV export of data stored in a MongoDB instance
mongoexport --db dbName --collection collectionName --jsonArray --pretty --query '{"key": "value"}' --output output.json
For more details, please refer to mongoDB documentation.
Upvotes: 1