سؤال

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

هل كانت مفيدة؟

المحلول

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

نصائح أخرى

You have to say the file type you are importing

mongoimport --db geo --collection points --file zips.json --type json 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top