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

XMLWordPrintableJSON

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

      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
              Reporter:
              Robert Guo (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: