Open this example in the interactive library
Source code
SELECT json_set('{"theme":{"mode":"dark","scale":1}}','$.theme.scale',2) AS preferences;
Sample output
[
{
"preferences": "{\"theme\":{\"mode\":\"dark\",\"scale\":2}}"
}
]
Open this example in the interactive library
SELECT json_set('{"theme":{"mode":"dark","scale":1}}','$.theme.scale',2) AS preferences;
[
{
"preferences": "{\"theme\":{\"mode\":\"dark\",\"scale\":2}}"
}
]