'null', 'boolean', 'number', 'string', 'array', or 'object'.
Returns NULL if the input is NULL.
The argument may be either a native JSON value (which is inspected directly, without re-parsing) or a TEXT value containing a JSON document (which is parsed).
Syntax
Aliases
Parameters
| Parameter | Description | Supported input types |
|---|---|---|
<json> | The JSON value whose type is reported. | JSON, TEXT |
Return Type
TheJSON_TYPEOF function returns a result of type TEXT.
Remarks
When the argument is a nativeJSON value it is already validated, so the type is determined directly from the stored representation.
When the argument is TEXT, the input is parsed and an error is raised if it is not valid JSON.
Examples
The following examples report the type of each nativeJSON value:
TEXT value containing a JSON document, which is parsed before its type is reported: