JSON functions were added in MariaDB 10.2.3.
JSON_TYPE(json_val)
Returns the type of a JSON value, or NULL if the argument is null.
An error will occur if the argument is an invalid JSON value.
The following is a complete list of the possible return types:
Return type | Value |
---|---|
ARRAY | JSON array |
BIT | MariaDB BIT scalar |
BLOB | MariaDB binary types (BINARY, VARBINARY or BLOB) |
BOOLEAN | JSON true/false literals |
DATE | MariaDB DATE scalar |
DATETIME | MariaDB DATETIME or TIMESTAMP scalar |
DECIMAL | MariaDB DECIMAL or NUMERIC scalar |
DOUBLE | MariaDB DOUBLE FLOAT scalar |
INTEGER | MariaDB integer types (TINYINT, SMALLINT, MEDIUMINT, INT or BIGINT) |
NULL | JSON null literal or NULL argument |
OBJECT | JSON object |
OPAQUE | Any valid JSON value that is not one of the other types. |
STRING | MariaDB character types (CHAR, VARCHAR, TEXT, ENUM or SET) |
TIME | MariaDB TIME scalar |
SELECT JSON_TYPE('{"A": 1, "B": 2, "C": 3}'); +---------------------------------------+ | JSON_TYPE('{"A": 1, "B": 2, "C": 3}') | +---------------------------------------+ | OBJECT | +---------------------------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/json_type/