title: how to check a date is less than today date in mongoose?
body: <p>my collection in db is </p>
  
  <pre><code>plannedEndDate:{"2020-03-10T11:22:33.677+00:00"}
  </code></pre>
  
  <p>in controller <code>var tdate= new Date();</code> [tdate is in the format 2020-03-10T14:28:22.687Z].
   now,I need to check plannedEndDate is less than tdate in mongoose.
  i tried,</p>
  
  <pre><code>plannedEndCmp: {
      $cond: [{ $lt: ["$plannedEndDate", tdate] }, 1, 0]
  }
  </code></pre>
  
  <p>but it is not returning true.
  so should i need to trim the timestamp to compare dates in mangodb?or should i need to convert date into common format?</p>