Importing and exporting to CSV
csv, export, import, mongodb
Solution
I finally found the problem. I was executing my command in mongo.exe. ( I opened C:\mongodb\bin>mongo and the executed my command )
C:\mongodb\bin>mongo
MongoDB shell version: 2.4.0
connecting to: test
>
> mongoimport --db denistestcsv --collection things --type csv --fields First,La
st,Visits,Location,Number,Url,Letter --file E:\temp\csv1.csv
But this is wrong. The correct way is going to mongo => bin => and then executing command without entering mongo.exe
C:\mongodb\bin>mongoimport --db denistestcsv --collection things --type csv --fi
elds First,Last,Visits,Location,Number,Url,Letter --file E:\temp\csv1.csv
Problem
Trying to import or export from MongoDB command line : ``` > mongoimport --db denistest --collection things --type csv --file C:/Users/Administrator/Desktop/csv_data.csv ``` I get : JavaScript execution failed: SyntaxError: Unexpected identifier What is wrong here?