- Reference >
- Operators >
- Aggregation Pipeline Operators >
- $size (aggregation)
$size (aggregation)¶
On this page
Definition¶
-
$size
¶ Counts and returns the total number of items in an array.
$size
has the following syntax:The argument for
$size
can be any expression as long as it resolves to an array. For more information on expressions, see Expressions.