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

Indexing an array can change query results

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.8.3
    • 1.9.1
    • None
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: