$set tries to update _id with case insensitive collation

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Works as Designed
    • Priority: Minor - P4
    • None
    • Affects Version/s: 4.4.5
    • Component/s: None
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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

       

            Assignee:
            Eric Sedor
            Reporter:
            Nitin Katkam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: