Filter on ISODate doesn't work

XMLWordPrintableJSON

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

      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
              Reporter:
              Lanfranco Morini
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: