Update Operators#
The following modifiers are available for use in update operations,
for example, in petdb.PetCollection.update() and petdb.PetCollection.update_one().
Warning
Any update operator doesn’t support nesting object query, you should only use the dot notation to specify fields.
{"$set": {"info.name": "Item 1"}} # Good
{"$set": {"info": {"name": "Item 1"}}} # Wrong
Fields#
Arrays#
Adds an item to an array. |
|
Adds elements to an array only if they do not already exist in the set. |
|
Removes all array elements that match a specified query. |