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

query on undefined field matches empty array

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.5
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      In some cases it is possible to query for the undefined type. If full document matching is bypassed, such a query can match an empty array, which is stored in the index using the undefined type.

      > c.ensureIndex( { a:1 } )
      > c.save( { a:[] } )
      > c.find( { a:{ $in:[ undefined ] } } )
      { "_id" : ObjectId("4f7a117c37365e9167f24ed3"), "a" : [ ] }
      > 

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: