JSON_MERGE
Description
This function merges multiple JSON documents. This function is equivalent to JSON_MERGE_PRESERVE().
Syntax
JSON_MERGE(json_doc, json_doc[, json_doc] ...)
Usage notes
The json_doc parameter specifies the JSON documents to be merged.
Examples
SELECT JSON_MERGE('[1, 2, 3]', '[true, false]', '{"a":100}');
+-------------------------------------------------------+
| JSON_MERGE('[1, 2, 3]', '[true, false]', '{"a":100}') |
+-------------------------------------------------------+
| [1, 2, 3, true, false, {"a": 100}] |
+-------------------------------------------------------+
1 row in set (0.001 sec)
SELECT JSON_MERGE('{"1": 2}', '[true, false]', '{"a":100}');
+------------------------------------------------------+
| JSON_MERGE('{"1": 2}', '[true, false]', '{"a":100}') |
+------------------------------------------------------+
| [{"1": 2}, true, false, {"a": 100}] |
+------------------------------------------------------+
1 row in set (0.001 sec)
SELECT JSON_MERGE('{"1": 2}', '{"a":100}');
+--------------------------------------+
| JSON_MERGE('{"1": 2}', '{"a":100}') |
+--------------------------------------+
| {"1": 2, "a": 100} |
+--------------------------------------+
1 row in set (0.001 sec)