Recently, I have been using mysql's json storage format, and a very strange problem has occurred.
INSERT INTO `json` (`notes`) VALUES ('[{"name":1}]');
I use the above statement to insert the json array, and the display of navicat is normal The
When I useUPDATE json SET notes =json_array_append(notes, '$' , '["sa"]' ) WHERE ID=6 ;
The escape character appears when adding new json
What's the problem?
json_array_append(notes, '$' , '["sa"]' )
改为json_array_append(notes, '$' , CAST('["sa"]' AS JSON))