mingo-app / mingo

Found a bug? have a FR ?
60 stars 2 forks source link

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

Closed jmisur closed 3 months ago

jmisur commented 11 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):

tothradoslav commented 3 months ago

We improved this behaviour as requested. It will convert all extended JSON params into JS before using.

tothradoslav commented 3 months ago

This issue is fixed / available in the new release v1.14.1

https://github.com/mingo-app/mingo/releases/tag/v1.14.1

Please reopen this issue if necessary.