SyntaxStudy
Sign Up
MySQL Intermediate 3 min read

Removing JSON Keys

JSON_REMOVE

JSON_REMOVE() removes a key from a JSON document at the specified path.

Example
UPDATE products
SET attributes = JSON_REMOVE(attributes, '$.ssd')
WHERE id = 1;

-- Verify removal
SELECT attributes->'$.ssd' FROM products WHERE id = 1;
-- Returns NULL
Pro Tip

JSON_REMOVE does not error if the path does not exist — it is a no-op.