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

Update with $text only updates half of matching docs if docs have moved

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 2.5.5
    • Text Search, Write Ops
    • Fully Compatible
    • ALL
    • Hide

      Can't reproduce on 2.5.4, can reproduce on master: 9cfca59caf6426bf3c14fa3730aa58003b223386

      db.test.drop()
      db.test.insert({ a: "dog" })
      db.test.insert({ a: "dog" })
      db.test.ensureIndex({ a: "text" })
      db.test.update(
          { $text: { $search: "dog" } },
          { $set: { b: 1 } },
          { multi: true }
      )
      assert.eq(db.test.count({ b: 1 }), 2)

      Show
      Can't reproduce on 2.5.4, can reproduce on master: 9cfca59caf6426bf3c14fa3730aa58003b223386 db.test.drop() db.test.insert({ a: "dog" }) db.test.insert({ a: "dog" }) db.test.ensureIndex({ a: "text" }) db.test.update( { $text: { $search: "dog" } }, { $set: { b: 1 } }, { multi: true } ) assert.eq(db.test.count({ b: 1 }), 2)

    Description

      Updates with a text predicate does not update all of the matched documents if the update results in moves. It seems to update half of those that matched (if 8 match 4 get updated, if 2 match 1 gets updated).

      Attachments

        Activity

          People

            benety.goh@mongodb.com Benety Goh
            tyler@10gen.com Tyler Brock
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: