[SERVER-44327] Add $first and $last expressions Created: 30/Oct/19  Updated: 29/Oct/23  Resolved: 25/Nov/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 4.3.3

Type: New Feature Priority: Major - P3
Reporter: Charlie Swanson Assignee: David Percy
Resolution: Fixed Votes: 0
Labels: neweng, pm1457
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-13181 Investigate changes in SERVER-44327: ... Closed
Duplicate
is duplicated by SERVER-41346 all accumulators should be available ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2019-12-02
Participants:

 Description   

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> }



 Comments   
Comment by Githook User [ 25/Nov/19 ]

Author:

{'email': 'david.percy@mongodb.com', 'name': 'David Percy', 'username': 'dpercy'}

Message: SERVER-44327 Add $first and $last expressions
Branch: master
https://github.com/mongodb/mongo/commit/34e093782f53dec39ff89116c0c7128430c99bae

Generated at Thu Feb 08 05:05:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.