Andre
Andre

Reputation: 1277

Error running mongoImport from the mongo shell

I have a problem importing a json-file with MongoDB. The desired file is in the folder (when I execute the command ls() the file is listed) but the method gives me this error:

mongoimport --db geo --collection points --file zips.json Wed Mar 19 09:42:49.032 SyntaxError: Unexpected identifier

Can anyone tell me what I do wrong.

Greetings, Andre

Upvotes: 0

Views: 1421

Answers (2)

Andre
Andre

Reputation: 1277

ok,that is pretty stupid. you have to insert the mongoimport --db --coll... in the normal cmd and not in the mongo-shell. then it works without problems

Upvotes: 3

jabaldonedo
jabaldonedo

Reputation: 26602

You have to say the file type you are importing

mongoimport --db geo --collection points --file zips.json --type json 

Upvotes: 1

Related Questions