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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
    • Operating System:
      ALL

      Description

      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 }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: