title: Java to Mongo Document date
body: <p>I am inserting a document by converting the pojo to document object using static parse method from Mongo driver. </p>
  
  <pre><code>Document newList = parse(gson.toJson(myPoJo));
  collections.insertOne(newList);
  </code></pre>
  
  <p>This pojo has a Date attribute. But parse method will not adhere this type and convert it to string i think. So after insert my document is something like below.</p>
  
  <pre><code> { "auditInfo" : {
          "updatedDate" : "Feb 28, 2000 3:39:20 PM",
     } 
  }
  </code></pre>
  
  <p>Problem with this is i wont be able to perform date comparison in mongo query. </p>
  
  <p>Please advise on how to handle this.  </p>