mingo-app / mingo

Found a bug? have a FR ?
59 stars 3 forks source link

Aggregation pipeline with date comparison using extended json does not work #624

Open jmisur opened 6 months ago

jmisur commented 6 months ago

Describe the bug I'm copy-pasting an aggregation pipeline from spring mongodb log. The pipeline is working correctly in my application (records are found). It uses MongoDB Extended json relaxed date format.

{
  "startedAt": {
    "$gte": {
      "$date": "2023-12-21T11:25:58.344Z"
    }
  }
}

However in Mingo, this produces no results for the match stage. When I rewrite it to new Date format, the results are there.

{
  "startedAt": {
    "$gte": new Date("2023-12-21T11:25:58.344Z")
  }
}

The startedAt field in the document is of type Date.

Screenshots Screenshot 2023-12-21 at 13 32 58 Screenshot 2023-12-21 at 13 33 22

Desktop (please complete the following information):