Skip to content

Commit 4909d43

Browse files
authored
(DOCS-16471) getField supports strings that are not string literal (#5197)
1 parent ab3e58b commit 4909d43

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

source/reference/operator/aggregation/getField.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ Syntax
5656
- String
5757
- Field in the ``input`` object for which you want to return a
5858
value. ``field`` can be any valid :ref:`expression
59-
<aggregation-expressions>` that resolves to a string
60-
constant.
59+
<aggregation-expressions>` that resolves to a string.
6160

6261
If ``field`` begins with a dollar sign (``$``), place the field
63-
name inside of a :expression:`$literal` expression to return its
64-
value.
62+
name inside of a :expression:`$literal` or
63+
:expression:`$toString` expression to return its value.
6564

6665
* - ``input``
6766
- Object
@@ -89,9 +88,6 @@ described above.
8988
Behavior
9089
--------
9190

92-
- If ``field`` resolves to anything other than a string constant,
93-
:expression:`$getField` returns an error.
94-
9591
- If the ``field`` that you specify is not present in the ``input``
9692
object, or in :variable:`$$CURRENT <CURRENT>` if you don't specify an
9793
``input`` object, :expression:`$getField` returns ``missing``.

0 commit comments

Comments
 (0)