Array Update Operators
On this page
MongoDB 5.0 is end of life as of October 2024. This version of the documentation is no longer
supported. To upgrade your 5.0 deployment, see the MongoDB 6.0 upgrade procedures.
Note
For details on a specific operator, including syntax and examples, click on the link to the operator's reference page.
Update Operators
Name | Description |
---|---|
Acts as a placeholder to update the first element that matches the query condition. | |
Acts as a placeholder to update all elements in an array for the documents that match the query condition. | |
Acts as a placeholder to update all elements that match the arrayFilters condition for the documents that match the query condition. | |
Adds elements to an array only if they do not already exist in the set. | |
Removes the first or last item of an array. | |
Removes all array elements that match a specified query. | |
Adds an item to an array. | |
Removes all matching values from an array. |