Reference material for JSON operators
->>
/
in field names are escaped and not interpreted as JSON path separators.
Parameter | Description | Supported input types |
---|---|---|
<json> | The JSON document. | TEXT |
<field_name> | Name of the JSON field for which the value should be extracted. | TEXT |
TEXT
NULL
, the function will return NULL
.NULL
.CREATE TABLE
and INSERT
statements set up the examples.
?column? (TEXT) |
---|
‘123’ |
?column? (TEXT) |
---|
‘3’ |
~
and /
in the field name when using the ->>
operator.
Example
?column? (TEXT) |
---|
'{\n "dyid": 987,\n "keywords" : ["insanely","fast","analytics"]\n }\n' |
value
as a TEXT
value.
Example
?column? (TEXT) |
---|
‘987’ |
->>
operator retrieves the nested JSON document in text form. Applying the second ->>
operator on the nested JSON document returns the value associated with the JSON field dyid
. The operator returns this value as a string.
Example
?column? (TEXT) |
---|
NULL |
value/dyid
. The ->>
operator never looks into nested JSON documents.