JSON_OBJECT_TO_ARRAY
Explore JSON_OBJECT_TO_ARRAY in MariaDB. Available from version 11.2, this function converts JSON objects into arrays of key-value pairs, facilitating operations like finding common values when used w
Syntax
JSON_OBJECT_TO_ARRAY(Obj)Description
Examples
SET @obj1= '{ "a": [1, 2, 3], "b": { "key1":"val1", "key2": {"key3":"val3"} }}';
SELECT JSON_OBJECT_TO_ARRAY(@obj1);
+-----------------------------------------------------------------------+
| JSON_OBJECT_TO_ARRAY(@obj1) |
+-----------------------------------------------------------------------+
| [["a", [1, 2, 3]], ["b", {"key1": "val1", "key2": {"key3": "val3"}}]] |
+-----------------------------------------------------------------------+Last updated
Was this helpful?

