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