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

$rename doesn't rename fields with dots (.)

    XMLWordPrintable

    Details

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

      Description

      `$rename` cannot rename fields with dots (.) in their names:

      A collections like:

      > db.test.find()
      { "_id" : ObjectId("578ec46e39b3c19fbbeb2264"), "a.b" : 1 }
      { "_id" : ObjectId("578ec46e39b3c19fbbeb2262"), "a.b" : 2 }
      >
      

      won't get updated with:

      > db.test.update({}, { $rename : { "a.b" : "ab" }}, false, true);
      WriteResult({ "nMatched" : 2, "nUpserted" : 0, "nModified" : 0 })
      >
      > db.test.find()
      { "_id" : ObjectId("578ec46e39b3c19fbbeb2264"), "a.b" : 1 }
      { "_id" : ObjectId("578ec46e39b3c19fbbeb2262"), "a.b" : 2 }
      >
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kelsey.schubert Kelsey T Schubert
              Reporter:
              amar.hamzeh Amar Hamzeh
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: