Write or replace a value inside a JSON document.
Section: json and string functions
Update a JSON path
sql
sql
UPDATE user_preferences
SET settings = JSON_SET(settings, '$.theme', 'dark')
WHERE user_id = 42;Explanation
Useful for gradually evolving settings blobs without replacing the whole document manually.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing json and string functions