$toUpper (aggregation)
On this page
Definition
-
$toUpper
-
Converts a string to uppercase, returning the result.
$toUpper
has the following syntax:The argument can be any expression as long as it resolves to a string. For more information on expressions, see Expressions.
If the argument resolves to null,
$toLower
returns an empty string""
.
Behavior
$toUpper
only has a well-defined behavior for strings of ASCII characters.
Example
Consider a inventory
collection with the following documents:
The following operation uses the $toUpper
operator return uppercase item
and uppercase description
values:
The operation returns the following results: