$firstN can be used as an aggregation accumulator or array operator.
As an aggregation accumulator, it returns an aggregation of the first n elements within a group.
As an array operator, it returns the specified number of elements from the beginning of an array.
$firstN can be used as an aggregation accumulator or array operator. As an aggregation accumulator, it returns an aggregation of the first n elements within a group. As an array operator, it returns the specified number of elements from the beginning of an array.