I want to update JSON array in the database
I'v got this array:
Array
(
[id] => 34
[var1] => val1
[var2] => val2
[var3] => val3
)
and I need to update json by the id
query sample:
JOSN_SET(`json_arr`,'$."34"','{"id":"34","var1":"val1","var2":"val2","var3":"val3"}')
expected result :
{"34":{"id":"34","var1":"val1","var2":"val2","var3":"val3"}}
result :
{"34":"{\"id\":\"34\",\"var1\":\"val1\",\"var2\":\"val2\",\"var3\":\"val3\"}"}
Thanks for the help.