Product Solutions Support
Try MemSQL

JSON_DELETE_KEY

Removes a named key and value from a JSON map. Maps are in the form:

{"a": 1, "b": 2, "c": 3}
JSON_DELETE_KEY(json, keyname)

Arguments

Return Type

Examples

mysql> select json_delete_key('{"a": 1, "b": 2, "c": 3}', 'a') as del;
+---------------+
| del           |
+---------------+
| {"b":2,"c":3} |
+---------------+

mysql> select json_delete_key('{"a": 1, "b": 2, "c": 3}', 'z') as nochange;
+---------------------+
| nochange            |
+---------------------+
| {"a":1,"b":2,"c":3} |
+---------------------+
Was this article useful?