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

$set tries to update _id with case insensitive collation

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Icon: Minor - P4 Minor - P4
    • None
    • 4.4.5
    • None
    • None

    Description

      Problem Description

      This initially started off as TOOLS-2865

      When performing an update with a $set containing an _id, the server does not ignore the new _id value if it is the same as the current value when using a case-insensitive collation.

      Steps to Reproduce

      db.createCollection("testimpcase", {collation: {locale: "en", strength: 1}})
      db.testimpcase.insertOne({_id: "abc", value: 1})
      db.testimpcase.updateOne({_id: "abc"}, {"$set" : { _id: "ABC"}})

      Expected Results

      The server should return a 0 documents modified.

      Actual Results

      Error, _id is immutable

      Additional Notes

       

      Attachments

        Activity

          People

            eric.sedor@mongodb.com Eric Sedor
            nitin.katkam@mongodb.com Nitin Katkam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: