@@ -26,19 +26,21 @@ Definition
2626 { $arrayElemAt: [ <array>, <idx> ] }
2727
2828 The ``<array>`` expression can be any valid :ref:`expression
29- <aggregation-expressions>` as long as it resolves to an array.
29+ <aggregation-expressions>` that resolves to an array.
3030
3131 The ``<idx>`` expression can be any valid :ref:`expression
32- <aggregation-expressions>` as long as it resolves to an integer.
32+ <aggregation-expressions>` that resolves to an integer:
3333
34- - If positive, :expression:`$arrayElemAt` returns the element at the
35- ``idx`` position, counting from the start of the array.
34+ - If the ``<idx>`` expression resolves to zero or a positive integer,
35+ :expression:`$arrayElemAt` returns the element at the ``idx``
36+ position, counting from the start of the array.
3637
37- - If negative, :expression:`$arrayElemAt` returns the element at the
38- ``idx`` position, counting from the end of the array.
38+ - If the ``<idx>`` expression resolves to a negative integer,
39+ :expression:`$arrayElemAt` returns the element at the ``idx``
40+ position, counting from the end of the array.
3941
40- If the ``idx`` exceeds the array bounds, :expression:`$arrayElemAt`
41- does not return any result.
42+ If ``idx`` exceeds the array bounds, :expression:`$arrayElemAt` does
43+ not return a result.
4244
4345 For more information on expressions, see
4446 :ref:`aggregation-expressions`.
0 commit comments