- Reference >
- Operators >
- Update Operators >
- Array Update Operators >
- $each
$each¶
Note
The $each
modifier is only used with the
$addToSet
and $push
operators.
See the documentation of $addToSet
and $push
for more information.
-
$each
¶ The
$each
modifier is available for use with the$addToSet
operator and the$push
operator.Use the
$each
modifier with the$addToSet
operator to add multiple values to an array<field>
if the values do not exist in the<field>
.Use the
$each
modifier with the$push
operator to append multiple values to an array<field>
.