Navigation
This version of the manual is no longer supported.

$first (aggregation)

$first

Returns the first value it encounters for its group.

Note

Only use $first when the $group follows a $sort operation. Otherwise, the result of this operation is unpredictable.