Matching null against an empty array behaves differently without an index

XMLWordPrintableJSON

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

      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
            Reporter:
            Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: