JSON functions were added in MariaDB 10.2.3.
JSON_REMOVE(json_doc, path[, path] ...)
Removes data from a JSON document returning the result, or NULL if any of the arguments are null. If the element does not exist in the document, no changes are made.
An error will occur if JSON document is invalid, the path is invalid or if the path contains a *
or **
wildcard.
Path arguments are evaluated from left to right, with the result from the earlier evaluation being used as the value for the next.
SELECT JSON_REMOVE('{"A": 1, "B": 2, "C": {"D": 3}}', '$.C'); +-------------------------------------------------------+ | JSON_REMOVE('{"A": 1, "B": 2, "C": {"D": 3}}', '$.C') | +-------------------------------------------------------+ | {"A": 1, "B": 2} | +-------------------------------------------------------+ SELECT JSON_REMOVE('["A", "B", ["C", "D"], "E"]', '$[1]'); +----------------------------------------------------+ | JSON_REMOVE('["A", "B", ["C", "D"], "E"]', '$[1]') | +----------------------------------------------------+ | ["A", ["C", "D"], "E"] | +----------------------------------------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/json_remove/