Question

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

Was it helpful?

Solution

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

OTHER TIPS

You have to say the file type you are importing

mongoimport --db geo --collection points --file zips.json --type json 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top