UpdateMany doesn't support links to existing fields

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: Core API
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Summary

      Go driver's UpdateMany doesn't update fields using existing fields in object.
       
      col.UpdateMany(ctx,bson.M{“id”:123},bson.D{"$set", bson.D{“PreviousRecord”,"$CurrentRecord")}}

      This command will update object:
      {{

      { id:123, PreviousRecord:"old", CurrentRecord:"new" }

      }}

      as:
      {{

      { id:123, PreviousRecord:"$CurrentRecord", CurrentRecord:"new" }

      }}

      MongoDB 4.4 (docker image mongo:4.4); GO-driver 1.7.1

       

       

            Assignee:
            Benji Rewis (Inactive)
            Reporter:
            Apocalypsy .
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: