find() or mapreduce query with { $date: '...' } doesn't work, only ISODate('...')

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.2.2
    • Component/s: Querying
    • None
    • Environment:
      direct connection to both primary and secondary nodes in replica set. CentOS Unix, mongod 2.2.2.
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Using both Java driver 2.10.1 and the mongo shell, if I perform a find() (or a mapreduce with same initial query), if I use

      { $date: '...' }

      to specify a date value, no results are found and also the query takes a long time to complete. If I use ISODate('...') (in the shell), the query completes quickly and finds results.

      Shell transcript:

      shard1ReplSet:PRIMARY> db.engagement_events.find({t: { $gte:

      { $date: '2013-01-16T04:00:00Z' }

      } }).count()
      0
      shard1ReplSet:PRIMARY> db.engagement_events.find({t:

      { $gte: ISODate('2013-01-16T04:00:00Z') }

      }).count()
      98024

      Are ISO datetime format strings no longer supported?

              Assignee:
              Unassigned
              Reporter:
              Robin Thomas
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: