arrayFilters( <array of filter documents> )
New in version 3.6.
Determines which array elements to modify for an update operation on an array field:
In the update document, use the
$[<identifier>]filtered positional operator to define an identifier, which you then reference in the array filter documents. You cannot have an array filter document for an identifier if the identifier is not included in the update document.
<identifier>must begin with a lowercase letter and contain only alphanumeric characters.
You can include the same identifier multiple times in the update document; however, for each distinct identifier (
$[identifier]) in the update document, you must specify exactly one corresponding array filter document. That is, you cannot specify multiple array filter documents for the same identifier. For example, if the update statement includes the identifier
x(possibly multiple times), you cannot specify the following for
arrayFiltersthat includes 2 separate filter documents for
However, you can specify compound conditions on the same identifier in a single filter document, such as in the following examples: