LENGTH (NoSQL query)
APPLIES TO: NoSQL
Returns the number of characters in the specified string expression.
Syntax
LENGTH(<string_expr>)
Arguments
Description | |
---|---|
string_expr |
A string expression. |
Return types
Returns a numeric expression.
Examples
The following example returns the length of a static string.
SELECT VALUE {
stringValue: LENGTH("AdventureWorks"),
emptyString: LENGTH(""),
nullValue: LENGTH(null),
numberValue: LENGTH(0),
arrayValue: LENGTH(["Adventure", "Works"])
}
[
{
"stringValue": 14,
"emptyString": 0
}
]
Remarks
- This system function doesn't use the index.
Related content
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for