LENGTH (Azure Cosmos DB)

APPLIES TO: SQL API

Returns the number of characters of the specified string expression.

Syntax

LENGTH(<str_expr>)  

Arguments

str_expr
Is the string expression to be evaluated.

Return types

Returns a numeric expression.

Examples

The following example returns the length of a string.

SELECT LENGTH("abc") AS len 

Here is the result set.

[{"len": 3}]  

Remarks

This system function will not utilize the index.

Next steps