user3806691
user3806691

Reputation: 55

MongoDb throws an error while importing using mongoImport

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

Upvotes: 1

Views: 2790

Answers (2)

user3806691
user3806691

Reputation: 55

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

Upvotes: 4

BanksySan
BanksySan

Reputation: 28500

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

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

Upvotes: 1

Related Questions