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

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • 3.6.0-rc6
    • 3.6.1, 3.7.1
    • Querying
    • Fully Compatible
    • ALL
    • v3.6
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: