$each

The `$each` modifier is used with $push and $addToSet operators to add multiple values to an array field.

Syntax

{ $push: { field: { $each: [ <value1>, <value2>, ... ] } } }

Parameters

fieldstringrequired

The field to update.

<value1>, <value2>stringrequired

The values to add to the array.