I am trying to import a CSV file with one specific column being of type date-time using mongoimport utility
As of MongoDB version 3.4 we can use --columnsHaveTypes which instructs mongoimport that the field list specified in --headerline are of specific type.
My CSV file look like this
TIME,TPS
2006-01-02 07:25:24,1
2006-01-02 07:25:25,2
2006-01-02 07:25:26,2
2006-01-02 07:25:27,2
2006-01-02 07:25:28,2
2006-01-02 07:25:29,2
2006-01-02 07:25:30,1
2006-01-02 07:25:31,3
commands the i have executed but have error-ed out
>>mongoimport --db test1 --collection tpsformat --type csv --file C:\ARMS\TestTPS.csv --headerline TIME.date\(2006-01-02 15:04:05\),TPS.string\(\) --columnsHaveTypes --maintainInsertionOrder
2017-08-22T16:36:52.114+0530 error validating settings: only one positional argument is allowed
2017-08-22T16:36:52.119+0530 try 'mongoimport --help' for more information
>>mongoimport --db test1 --collection tpsformat --type csv --file C:\ARMS\TestTPS.csv --headerline TIME.string\(\),TPS.string\(\) --columnsHaveTypes --maintainInsertionOrder
2017-08-22T16:36:59.539+0530 error validating settings: incompatible options: --file and positional argument(s)
2017-08-22T16:36:59.543+0530 try 'mongoimport --help' for more information
However a simple import without --columnsHaveTypes executes fine
>>mongoimport --db test1 --collection tpsformat --type csv --file C:\ARMS\TestTPS.csv --headerline --maintainInsertionOrder
2017-08-22T16:37:07.928+0530 connected to: localhost
2017-08-22T16:37:07.936+0530 imported 8 documents
Can someone suggest what I am doing wrong here.
Note: Have also tried removing the first line of CSV and the tried importing using --fields, however got exactly same error.
Thanks