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

Filter on ISODate doesn't work

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

      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().

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

              Created:
              Updated:
              Resolved: