$last
The$last operator returns the last element of an array.
Input
- A single array value
Output
- The last element of the array, or null if the array is empty
Examples
Get Last Element
5
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
$last operator returns the last element of an array.
{
"$last": [
[1, 2, 3, 4, 5]
]
}
5
{
"$last": [
{
"$input": "items"
}
]
}
