Indexing an array can change query results

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.9.1
    • Affects Version/s: 1.8.3
    • Component/s: None
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Creating an index on an array can cause documents to be omitted from query results.

      Reproduction steps:
      > doc =

      { _id : 1, arr : [] }

      ;

      { "_id" : 1, "arr" : [ ] }

      > db.test.insert(doc);
      > db.test.findOne(doc);

      { "_id" : 1, "arr" : [ ] }

      > db.test.ensureIndex(

      { arr : 1 }

      );
      > db.test.findOne(doc);
      null

              Assignee:
              Unassigned
              Reporter:
              Bryon Ross
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: