Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-44327

Add $first and $last expressions

    • Fully Compatible
    • Query 2019-12-02
    • None
    • None
    • None
    • None
    • None
    • None
    • None

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

            Assignee:
            david.percy@mongodb.com David Percy
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None