Appends one or more values to the end of an array within a JSON document. The path must point to an existing array.
JSONDiperbarui: 13 Jun 2026JSON_ARRAY_APPEND(json_doc, path, val[, path, val] ...)The source JSON document
The path to the array to append to
The value to append to the array
1 SELECT JSON_ARRAY_APPEND('{"tags": ["a", "b"]}', '$.tags', 'c') AS result;
Append 'c' to the end of the tags array.
1 SELECT JSON_ARRAY_APPEND('{"items": [1]}', '$.items', 2, '$.items', 3) AS result;
Append 2 and then 3 sequentially to the items array.
1 UPDATE products 2 SET tags = JSON_ARRAY_APPEND(tags, '$', 'new-tag') 3 WHERE id = 1;
Append a new tag to a product's tags array.
Sudah paham JSON_ARRAY_APPEND? Latih langsung di browser
Latihan interaktif, langsung di browser.