title | titleSuffix | description | author | ms.author | ms.reviewer | ms.service | ms.subservice | ms.topic | ms.devlang | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|---|---|---|
LOWER |
Azure Cosmos DB for NoSQL |
An Azure Cosmos DB for NoSQL system function that returns a string expression with uppercase characters converted to lowercase. |
jcodella |
jacodel |
sidandrews |
cosmos-db |
nosql |
reference |
nosql |
02/27/2024 |
query-reference |
[!INCLUDENoSQL]
Returns a string expression after converting uppercase character data to lowercase.
Note
This function automatically uses culture-independent (invariant) casing rules when returning the converted string expression.
LOWER(<string_expr>)
Description | |
---|---|
string_expr |
A string expression. |
Returns a string expression.
The following example shows how to use the function to modify various strings.
:::code language="nosql" source="~/cosmos-db-nosql-query-samples/scripts/lower/query.sql" highlight="2-6":::
:::code language="json" source="~/cosmos-db-nosql-query-samples/scripts/lower/result.json":::
- This function doesn't use the index.
- If you plan to do frequent case insensitive comparisons, this function may consume a significant number of RUs. Consider normalizing the casing of strings when ingesting your data. Then a query like
SELECT * FROM c WHERE LOWER(c.name) = 'USERNAME'
is simplified toSELECT * FROM c WHERE c.name = 'USERNAME'
.