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

Matching null against an empty array behaves differently without an index

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

      I think the behavior with an index is correct (or at least desirable) here.

      > db.foo.drop()
      true
      > db.foo.insert(

      {a:[]}

      )
      > db.foo.find(

      {a:null}

      )
      > db.foo.ensureIndex(

      {a:1}

      )
      > db.foo.find(

      {a:null}

      )

      { "_id" : ObjectId("4ddd6ebe90a1203088d20f68"), "a" : [ ] }

            Assignee:
            Unassigned Unassigned
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: