1.查询
select * from t_xxx where JSON_CONTAINS(viewers,JSON_OBJECT('id',166));
2.查询后替换某个
update t_xxx set viewers=JSON_REPLACE(viewers, '$[0].id', 166) where JSON_CONTAINS(reviewers,JSON_OBJECT('id',31));
1.查询
select * from t_xxx where JSON_CONTAINS(viewers,JSON_OBJECT('id',166));
2.查询后替换某个
update t_xxx set viewers=JSON_REPLACE(viewers, '$[0].id', 166) where JSON_CONTAINS(reviewers,JSON_OBJECT('id',31));