1

I am learning MongoDB and for practice i downloaded the restaurant data from mongodb site. I am using windows OS and mongo is installed properly. Now, I want to insert all the restaurant documents ( i.e json data) to mongodb. I am using cmd and tried this command

 mongoimport --db test --collection restaurants --drop --file ~/downloads/primer-dataset.json

but it failed and got the message that

 SyntaxError: missing ; before statement @(shell):1:4

How to solve this error? Please help me because I couldn't find satisfactory answer even after spending too much time.

1 Answer 1

1

mongoimport must be run from the Windows command prompt, not the mongo shell.

Sign up to request clarification or add additional context in comments.

1 Comment

@siddharthpal Are you sure? That's the error you get if you try and run that command within the mongo shell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.