JSON_TYPE()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
A description for this Function has not yet been added to this Documentation.
EXAMPLES
SET @json = '{"1": 1, "2": 2, "c": 3}';
SELECT JSON_TYPE(@json);
+------------------+
| JSON_TYPE(@json) |
+------------------+
| OBJECT |
+------------------+
SET @json = '{"1": 1, "2": 2, "c": 3}';
SELECT JSON_TYPE(JSON_EXTRACT(@json, '$.c'));
+---------------------------------------+
| JSON_TYPE(JSON_EXTRACT(@json, '$.c')) |
+---------------------------------------+
| INTEGER |
+---------------------------------------+
SELECT JSON_TYPE(JSON_EXTRACT('{"a": [1, true]}', '$.a[1]'));
+-------------------------------------------------------+
| JSON_TYPE(JSON_EXTRACT('{"a": [1, true]}', '$.a[1]')) |
+-------------------------------------------------------+
| BOOLEAN |
+-------------------------------------------------------+
SELECT JSON_TYPE(JSON_EXTRACT('{"a": [1, []]}', '$.a[1]'));
+-----------------------------------------------------+
| JSON_TYPE(JSON_EXTRACT('{"a": [1, []]}', '$.a[1]')) |
+-----------------------------------------------------+
| ARRAY |
+-----------------------------------------------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.