Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-836

Filter on ISODate doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: MongoDB 3.2
    • Labels:
    • Environment:
      Mac OS 10.11.1 "El Capitan"

      Description

      Hi,
      applying a filter using node.js driver on a DateTime tag (it's represented as an ISODate) as follows, no documents are returned.

      Park.aggregate([
      {
      $match:

      { "allocations.employeeCode": _employeeCode ,"allocations.date": new Date("2016-10-19T22:00:00.000Z") }

      }])

      Writing the query directly in the mongoDB shell as follows, it returns the expected documents.

      Park.aggregate([
      {
      $match:

      { "allocations.employeeCode": _employeeCode ,"allocations.date": ISODate("2016-10-19T22:00:00.000Z") }

      }])
      It seems that node.js drivers doesn't translate correctly the javascript syntax in the mongoDB shell one.

      Please note, that we are experiencing the same issue also using find().

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            lanfranco.morini@cegeka.it Lanfranco Morini
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: