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

Indexing an array can change query results

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

      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 Unassigned
            Reporter:
            bross@playdom.com Bryon Ross
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: