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.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.6.1, 3.7.1
    • Affects Version/s: 3.6.0-rc6
    • Component/s: Querying
    • Labels:
    • Fully Compatible
    • ALL
    • v3.6
    • Query 2017-12-04, Query 2017-12-18

      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 }
      

            Assignee:
            justin.seyster@mongodb.com Justin Seyster
            Reporter:
            robert.guo@mongodb.com Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: