美文网首页
Mysql json中list数据更新

Mysql json中list数据更新

作者: jojo1313 | 来源:发表于2022-07-06 15:41 被阅读0次

字典嵌套数组格式处理

form_data列值如下:

{"textarea_11": "123", "imgupload": [{"key": "1655089936494_94427", "url": "http://192.168.1.129:99/static/uploadfile/images/aa.jpg", "percent": 100}]} 

查url

select form_data->'$.imgupload[0].url',id from mysqltable where form_data like '%99%' ;

更新aa.jpg改成bb.jpg

update mysqltable set form_data=json_replace(form_data,'$.imgupload[0].url',"http://192.168.1.129:99/static/uploadfile/images/bb.png)") where id=xx;

相关文章

网友评论

      本文标题:Mysql json中list数据更新

      本文链接:https://www.haomeiwen.com/subject/jtsybrtx.html