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
ParameterTypeRequiredDescription
exprVARCHARYesThe 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 VARCHARf2 VARCHARf3 VARCHAR
{"name": "Alice", "age": 30}[1, 2, 3, 4, 5]42

Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19