MongoDBUpdate Operators


Syntax

  • { $set: { <field1>:<value1>, <field2>:<value2>, ... } }

Parameters

parametersMeaning
fieldNameField will be updated :{name: 'Tom'}
targetVauleValue will be assigned to the field :{name: 'Tom'}

Remarks

Reference for $set operator: $set on offical website