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
Error running mongoImport from the mongo shell
-
17-06-2023 - |
Pergunta
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
Solução
Outras dicas
You have to say the file type you are importing
mongoimport --db geo --collection points --file zips.json --type json
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow