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

XMLWordPrintableJSON

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

      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
              Reporter:
              Andrew Emil (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: