Level 63
I have chosen to use REPLACE() method instead of JSON_REPLACE, it works fine.
But if there's a solution to use JSON_REPLACE as I needed, it's always interesting to know how to do.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I have a problem with JSON_REPLACE.
I need to replace all the keys named unit without knowing the exact path.
update table set params = json_replace(params, '$.*.unit', 'new unit') where condition = true;
I have tried with a * caracter, but it doesn't work.
It is possiblr to match any subkey without knowing the exact path ?
Thanks for your help.
V
Please or to participate in this conversation.