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

Indexing an array can change query results

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.8.3
    • Fix Version/s: 1.9.1
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            bross@playdom.com Bryon Ross
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: