Reputation: 667
I am writing this query in mongo shell
mongoexport --db database_name --collection collection_name --out filename.json
query to export but the error is
SyntaxError: unexpected identifier
can anybody help me ?
Upvotes: 0
Views: 55
Reputation: 4803
Mongoexport is a terminal command line utility to export data, not mongoshell functional directive. Try running the same in terminal.
$ mongoexport --db database_name --collection collection_name --out filename.json
Make sure you have all the utilities that come with mongo added to your path.
Upvotes: 1