mysql中對json數據的屬性進行更改或者添加

通過json_set進行對json字段的鍵值進行修改,如果存在就進行替換,如果不存在鍵值,就增加鍵值對.
update test  set json_data = json_set(json_data, "$.menu", 'asd') where true and user_id = '111111'

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章