Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8190

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 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

      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 Unassigned
            Reporter:
            rthomas@squarespace.com Robin Thomas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: