StringToBoolean (NoSQL query)
APPLIES TO: NoSQL
Converts a string expression to a boolean.
Syntax
StringToBoolean(<string_expr>)
Arguments
Description | |
---|---|
string_expr |
A string expression. |
Return types
Returns a boolean value.
Examples
The following example illustrates how this function works with various data types.
SELECT VALUE {
parseBooleanString: StringToBoolean("true"),
parseWithPrefix: StringToBoolean("true "),
parseWithSuffix: StringToBoolean(" false"),
parseWithWhitespace: StringToBoolean(" false "),
parseBoolean: StringToBoolean(true),
parseUndefined: StringToBoolean(undefined),
parseNull: StringToBoolean(null)
}
[
{
"parseBooleanString": true,
"parseWithPrefix": true,
"parseWithSuffix": false,
"parseWithWhitespace": false
}
]
Remarks
- This function doesn't use the index.
- If the expression can't be converted, the function returns
undefined
.
Note
For more information on the JSON format, see https://json.org.
Related content
Povratne informacije
https://aka.ms/ContentUserFeedback.
Uskoro: tokom 2024. postepeno ćemo ukidati probleme s uslugom GitHub kao mehanizam povratnih informacija za sadržaj i zamijeniti ga novim sistemom povratnih informacija. Za više informacija, pogledajtePošalјite i prikažite povratne informacije za