-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Fully Compatible
-
Query 2019-12-02
The query team has decided on the following semantics and syntax:
Name: $first/last
Evaluates to the value at the first (or last) position in the passed in array. Errors if the passed in value is not an array and not nullish. Evaluates to missing if the array is empty, which is consistent with $arrayElemAt's behavior. Evaluates to null if input is nullish.
Syntax:
{ $first: <Expression> }
- is documented by
-
DOCS-13181 Investigate changes in SERVER-44327: Add $first and $last expressions
- Closed
- is duplicated by
-
SERVER-41346 all accumulators should be available as expressions
- Closed