JSON_PARSE
All functions > JSON > JSON_PARSE
Returns the given string as a JSON expression.
Signatures
Returns: A JSON value parsed from the string
JSON_PARSE(expr: VARCHAR) → JSON sql
| Parameter | Type | Required | Description |
|---|---|---|---|
expr | VARCHAR | Yes | The JSON string to parse |
Notes
- Parses JSON string into JSON type
- Accepts valid JSON format strings
- Supports objects, arrays, and primitives
- Returns NULL if the string is not valid JSON
- Inverse of JSON_FORMAT
- Useful for converting stored JSON strings to queryable JSON
- Validates JSON syntax during parsing
- Use JSON_EXTRACT after parsing to access nested values
Examples
FeatureQL
SELECT
f1 := JSON_PARSE('{"name": "Alice", "age": 30}'), -- Parse JSON object string
f2 := JSON_PARSE('[1, 2, 3, 4, 5]'), -- Parse JSON array string
f3 := JSON_PARSE('42') -- Parse JSON number
;Result
| f1 VARCHAR | f2 VARCHAR | f3 VARCHAR |
|---|---|---|
| {"name": "Alice", "age": 30} | [1, 2, 3, 4, 5] | 42 |
On this page