title: Mongodb (v2.4.0) $match aggregate not working with date range
body: <p>I am using mongodb java driver thru maven repository (as below in pom.xml) to query transactions between date range with aggregate framwork.  The java driver generates following $match that I tried to validate on mongo console and found that it does not work:</p>
  
  <pre><code>db.transactions.aggregate(
  { "$match" : 
      { 
          "created_at" : { "$gt" : { "$date" : "2001-04-12T12:00:00.000Z"} , "$lte" : { "$date" : "2020-04-13T12:00:00.000Z"}}
      }
  }
  )
  </code></pre>
  
  <p>If I remove $date block and replace it with ISOdate function and date string then it seem to be working. I failed to understand why it does not work in java ($match JSON - I had fetched from eclipse to try in mongo console and that do not work as well.) </p>
  
  <pre><code>pom.xml
  &lt;dependency&gt;
      &lt;groupId&gt;org.mongodb&lt;/groupId&gt;
      &lt;artifactId&gt;mongo-java-driver&lt;/artifactId&gt;
      &lt;version&gt;2.11.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>does any one know why $date is not working with aggregate using MongoDB v2.4.0?</p>