title: MongoDB query between date range
body: <p>In my mongodb , the date column in string. It holds date time as 8/3/2020 13:50:19.</p>
  <p>I am unable to do any date range query. It's returning wrong results.</p>
  <p>My code is as follows :</p>
  <pre><code>{       
                  &quot;$match&quot;: {                
                             &quot;event.meterID.string&quot;: meter_no, 
                             &quot;event.dataTime.string&quot;: {
                                        &quot;$gte&quot;: prev,
                                        &quot;$lte&quot;: dt_string
                              } 
                          } 
                 }
  
  </code></pre>
  <p>Any help is much appreciated.</p>
  <pre><code>
  { &quot;_id&quot; : ObjectId(&quot;5f2707da47973204ce5e9d91&quot;), &quot;header&quot; : { &quot;endpointKeyHash&quot; : { &quot;string&quot; : &quot;mO5KmJVhbZMXAUrVD0uKIKf32/I=&quot; }, &quot;applicationToken&quot; : { &quot;string&quot; : &quot;96775772132708234336&quot; }, &quot;headerVersion&quot; : { &quot;int&quot; : 1 }, &quot;timestamp&quot; : { &quot;long&quot; : NumberLong(&quot;1596393434007&quot;) }, &quot;logSchemaVersion&quot; : { &quot;int&quot; : 4 } }, &quot;event&quot; : { &quot;meterID&quot; : { &quot;string&quot; : &quot;83.67.68.65.48.48.49.49&quot; }, &quot;rkw&quot; : { &quot;double&quot; : -4492 }, &quot;rkwh&quot; : { &quot;double&quot; : 2 }, &quot;rkvar&quot; : { &quot;double&quot; : -2331 }, &quot;rkv&quot; : { &quot;double&quot; : 6499574 }, &quot;rcurrent&quot; : { &quot;double&quot; : 29367 }, &quot;rhz&quot; : { &quot;double&quot; : 50021 }, &quot;rpf&quot; : { &quot;double&quot; : 650 }, &quot;ykw&quot; : { &quot;double&quot; : 0 }, &quot;ykwh&quot; : { &quot;double&quot; : 0 }, &quot;ykvar&quot; : { &quot;double&quot; : 0 }, &quot;ykv&quot; : { &quot;double&quot; : 6524626 }, &quot;ycurrent&quot; : { &quot;double&quot; : 15370 }, &quot;yhz&quot; : { &quot;double&quot; : 0 }, &quot;ypf&quot; : { &quot;double&quot; : 0 }, &quot;bkw&quot; : { &quot;double&quot; : 0 }, &quot;bkwh&quot; : { &quot;double&quot; : 0 }, &quot;bkvar&quot; : { &quot;double&quot; : 0 }, &quot;bkv&quot; : { &quot;double&quot; : 6616274 }, &quot;bcurrent&quot; : { &quot;double&quot; : 34841 }, &quot;bhz&quot; : { &quot;double&quot; : 0 }, &quot;bpf&quot; : { &quot;double&quot; : 0 }, &quot;dataTime&quot; : { &quot;string&quot; : &quot;8/3/2020 00:04:43&quot; } } }
  
  </code></pre>