I am doing some tests to see how I can import a simple .csv file into mongodb but it mongodb keeps returning "0 objects imported. Here are my steps:
1) create a simple .csv file named "a4.csv" in mongodb/bin with 4 columns and 6 records:
Model Make Price Mileage
audi a5 500 500
mercedes cla 333 434
ford fusion 555 500
mazda miata 222 434
nissan 370z 111 500
porsche cayenne 333 434
2) Run import command:
./mongoimport -d test -c cars --type csv --file a4.csv --headerline
Output:
tins-MBP:bin tinzors$ ./mongoimport -d test -c cars --type csv --file a4.csv --headerline
connected to: 127.0.0.1
2015-02-11T12:23:11.656-0500 imported 0 objects
There's no error anything. Can someone help me? Thank you!
export PATH=<mongodb-install-directory>/bin:$PATH, then you can run mongoimport command from anywhere.