$size

The `$size` operator matches any array with the specified number of elements.

Syntax

{ field: { $size: <number> } }

Parameters

fieldstringrequired

The field to query.

<number>numberrequired

The number of elements the array must contain.

Related