title: Using --columnsHaveTypes to import data from csv files into Mongodb specifying a specific field as date
body: <p>I am trying to import a <strong>CSV</strong> file with one specific column being of type <strong>date-time</strong> using mongoimport utility</p>
  
  <p>As of MongoDB version 3.4 we can use <strong>--columnsHaveTypes</strong> which instructs <strong>mongoimport</strong> that the field list specified in <strong>--headerline</strong> are of specific type.</p>
  
  <p>My CSV file look like this</p>
  
  <pre><code>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
  </code></pre>
  
  <p>commands the i have executed but have error-ed out</p>
  
  <pre><code> &gt;&gt;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
  </code></pre>
  
  <hr>
  
  <pre><code>&gt;&gt;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
  </code></pre>
  
  <hr>
  
  <p>However a simple import without --columnsHaveTypes executes fine</p>
  
  <pre><code>&gt;&gt;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
  </code></pre>
  
  <p>Can someone suggest what I am doing wrong here.</p>
  
  <p>Thanks</p>