Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
APPLIES TO:
NoSQL
Converts a string expression to an array.
StringToArray(<string_expr>)
Description | |
---|---|
string_expr |
A string expression. |
Returns an array.
The following example illustrates how this function works with various inputs.
SELECT VALUE {
parseEmptyArray: StringToArray("[]"),
parseArray: StringToArray('[ "coats", "gloves", "hats" ]'),
complexArray: StringToArray('[ { "types": [ "coats", "gloves" ] }, [ "hats" ], 76, false, null ]'),
nestedArray: StringToArray('[ [ "coats", "gloves" ], [ "hats" ] ]'),
invalidArray: StringToArray("[ 'coats', 'gloves', 'hats' ]"),
parseUndefined: StringToArray(undefined),
parseNull: StringToArray(null)
}
[
{
"parseEmptyArray": [],
"parseArray": [ "coats", "gloves", "hats" ],
"complexArray": [
{
"types": [ "coats", "gloves" ]
},
[ "hats" ],
76,
false,
null
],
"nestedArray": [
[ "coats", "gloves" ],
[ "hats" ]
]
}
]
undefined
.\"
or the surrounding quote must be a single quote.Note
For more information on the JSON format, see https://json.org.
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register now