1

Dear MongoDb experts,

So I have an assignment of which the first step is to import a java script file called Grades. I have the file stored in IPD351 folder in my C drive. I am running the following command in my command prompt after connecting to the mongo db server:

MongoDB Enterprise > mongoimport -d students -c grades <C:\foldername\filename.js 

But I get the following error:

2016-04-18T13:35:04.983-0500 E QUERY    [thread1] SyntaxError: missing ; before statement @(shell):1:15

Please help! If the file does not get imported I cannot do the remaining homework

2 Answers 2

4

RESOLVED! I was in the mongo enterprise, typed exit, got out of enterprise and then typed the import command and it worked! The new line looks like this:

C:\Users\Akhil\mongoDb> mongoimport -d students -c grades

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

Comments

1

Don't use the < just ype the file path:

mongoimport -d students -c grades C:\IPD351\grades.js

6 Comments

Thanks for the response but I do have the file path in there - for some reason stackoverflow is not displaying my file path. Let me edit the post above to reflect that
You're adding a < before the file path,
MongoDB Enterprise > mongoimport -d students -c grades C:\IPD351\grades.js 2016-04-18T14:26:19.098-0500 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:15
Maybe try downloading the file again?
Also, try adding --batchSize 1
|

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.