Reputation: 53
I am just starting with MongoDB and have to import a csv-file. As this file has a headerline with the titles, I want to use the headerline-option. But no matter what I try, it always says "unknown option".
mongoimport -d psdat -c data --type csv --file C:\programming\csv\sample.csv --headerline;
2017-08-09T12:48:25.560+0200 error parsing command line options: unknown option "headerline;"
2017-08-09T12:48:25.587+0200 try 'mongoimport --help' for more information
Does anybody know the solution to my problem or have any idea?
Thanks in advance
Upvotes: 1
Views: 1564
Reputation: 3887
It seems as if you are running on Windows from a Windows command prompt session, and that in that environment ; is being appended to --headerline which is causes mongoimport to not recognize --headerline.
You might be working from a copy-and-paste from a linux example where the shell will usually remove the ; before mongoimport sees it. As Neil Lunn says, just get rid of the ; character.
Upvotes: 1