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

{$type: 17} with _id as date causes error

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • ALL

      If you insert a document with _id as a date and then try to querying using {$type: 17} it will cause an error. Tested on 2.4.9 and 2.5.5-pre (git hash: f65a0b814b8c77e3fbe90bca0c061c9b77f6acdb)

      > db.blah.insert({_id: ISODate("0000-01-01")})
      > db.blah.find({_id: {$type: 17}})
      error: { "$err" : "wrong type for field () 17 != 9", "code" : 13111 }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            andrew.emil@10gen.com Andrew Emil (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: