Product Solutions Support
Try MemSQL

JSON_ARRAY_PUSH_<type>

This is a set of three JSON functions, which add the given element to the end of a JSON array. Arrays are of the form:

["foo", "bar", "baz"]
["foo", 1, 2, 3]

Return Type

Examples

mysql> select json_array_push_string('["foo", "bar"]', 'foo') as add_foo;
+---------------------+
| add_foo             |
+---------------------+
| ["foo","bar","foo"] |
+---------------------+

mysql> select json_array_push_json('["foo", false]', '{"a":"b"}') as add_map;
+-------------------------+
| add_map                 |
+-------------------------+
| ["foo",false,{"a":"b"}] |
+-------------------------+
Was this article useful?