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

query on undefined field matches empty array

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.5.5
    • Querying
    • None
    • Fully Compatible
    • 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

              benety.goh@mongodb.com Benety Goh
              aaron Aaron Staple
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: