1

I am getting an error while importing a json document into mongoDB installed on my mac. I saw on another forum that the syntax is as follows:

mongoimport --db db1 --collection collection1 --file /Users/chummi/Desktop/zips.json

Here db1 is my database and collection1 is my collection and /Users/chummi/Desktop/zips.json is the path where the json document is present. When I run this command, am getting the following error

"SyntaxError: Unexpected identifier"

and not able to understand what this is.Please suggest if the syntax and the paths are correct?

nshetty
  • 1,097
  • 2
  • 10
  • 7

1 Answers1

0

Are you running mongoimport from inside the mongodb shell instead of the command line of your mac? Importing JSON file using mongimport, keep getting `unexpected identifier`?

Community
  • 1
  • 1
ErlVolton
  • 6,714
  • 2
  • 15
  • 26
  • Thank you very much, this has saved me a lot of time. The command is working now at the command line of my mac, initially I was running from inside the mongodb shell. – nshetty Sep 15 '15 at 10:46