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

Indexes not updated when types change but values compare equally

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Gone away
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Indexing, Write Ops
    • Labels:
      None
    • Operating System:
      ALL

      Description

      The AccessMethod code above the indexes groups values into added, removed, and unchanged based on value comparisons. Since this doesn't consider types, all values where only the type changed are considered "unchanged" and the index is not notified of the change.

      > db.foo.insert({_id:1, a:1})
      WriteResult({ "nInserted" : 1 })
      > db.foo.ensureIndex({a:1})
      {
              "createdCollectionAutomatically" : false,
              "numIndexesBefore" : 1,
              "numIndexesAfter" : 2,
              "ok" : 1
      }
      > db.foo.find({a:1}, {a:1, _id:0})
      { "a" : 1 }
      > db.foo.save({_id:1, a: NumberLong(1)})
      WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
      > db.foo.find({a:1}, {a:1, _id:0})
      { "a" : 1 }
      > db.foo.find({a:1}, {a:1, _id:0}).hint({$natural: 1})
      { "a" : NumberLong(1) }
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: