Appearance
JSON_TYPEOF
Prerequisite: To use this function, enable the
enable_full_json
configuration parameter. For more details, refer to JSON Functions.
Returns the type of the outermost JSON element as a VARCHAR string. Possible types are object
, array
, string
, number
, boolean
, and null
.
sql
JSON_TYPEOF(jsonb_expression)
Examples
sql
select json_typeof('{"ticker": "INTC"}');
-- object
select json_typeof('{"ticker": "INTC"}':$.ticker);
-- string
select json_typeof('{"ticker": "INTC"}':$.price null on error);
-- <null>