For AI agents: a documentation index is available at https://www.mongodb.com/es/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

Array Update Operators

The following operators modify the contents of an array:

Name
Description

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.

Removes all matching values from an array.

Adds an item to an array.

To update specific array elements, you can also use the positional update operators or the arrayFilters option.

Rate this page