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

query on undefined field matches empty array

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.5
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL

      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" : [ ] }
      > 
      

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

              Created:
              Updated:
              Resolved: