I have a table called product_option_param that has a column povs of JSON type, which basically keeps JSON arrays with ids (for example, [1,2,3])
When I need to delete, for example, an id 1, I execute this:
UPDATE product_option_param
SET povs = JSON_REMOVE(
povs, replace(JSON_SEARCH(povs, 'one', 1), '"', '')
)
WHERE json_search(povs, 'one', 1) IS NOT NULL
But it just turns all cells that have 1 in the array into null. What am I doing wrong?