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

$rename does not update value if existing "to" field has the same numeric value but different type.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.6.0-rc6
    • Fix Version/s: 3.6.1, 3.7.1
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Sprint:
      Query 2017-12-04, Query 2017-12-18

      Description

      On 3.6, a $rename operator applied to a destination field that already exists, and has the same value as the source field, will not update that field. On 3.4, the field type is changed as expected.

      db.test.insert({to:NumberLong(100), from:100});
      db.test.update({},{$rename:{from:"to"}});
      db.test.findOne()
      // 3.6: { "to" : NumberLong(100) }
      // 3.4: { "to" : 100 }
      

        Attachments

          Activity

            People

            Assignee:
            justin.seyster Justin Seyster
            Reporter:
            robert.guo Robert Guo
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: