2021-11-26

MongoDB - Update field value using another field's value

db.test1.update(

    {

        "filter_field": 1,

    },

    [

        {$set: {

            "target_field": "$source_field"

        }}

    ]

); 

No comments:

Post a Comment