user3363813
user3363813

Reputation: 667

can not find unexpected undentifier in mongo db export query

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

Answers (1)

user3775217
user3775217

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

Related Questions