(三)修改JSON的函數
JSON_ARRAY_APPEND() #數組尾部追加元素
JSON_ARRAY_INSERT() #在數組的指定位置插入元素
JSON_REPLACE() #替換文檔中指定位置的元素
JSON_SET() #給文檔中指定位置的元素設置新值,如果元素不存在,則進行插入
JSON_MERGEPRESERVE() #將兩個文檔合並
JSON_REMOVE() #刪除文檔中指定位置的元素
1.JSON_ARRAY_APPEND()
SELECT JSON_ARRAY_APPEND('{"a":1,"b": [2, 3],"c":4}',"$.b","1") ,JSON_ARRAY_APPEND('["a",["b","c"],"d"]','$[1][0]','1')

2. JSON_ARRAY_INSERT()
SELECT JSON_ARRAY_INSERT('["a",["b","c"],"d"]','$[0]',"1"),JSON_ARRAY_INSERT('["a",["b","c"],"d"]','$[1]',"1")

3.JSON_REPALCE()
SELECT JSON_REPLACE('["a",["b","c"],"d"]','$[0]',"1",'$[1]',"2")

4. JSON_SET()
SELECT JSON_SET('{"a":1,"b":[2,3],"c":4}','$.a',"10",'$.d',"20")

5. JSON_MERGE_PRESERVE()
SELECT JSON_MERGE_PRESERVE('[1,2]','[3,4]')

6.JSON_REMOVE()
SELECT JSON_REMOVE('[1,2,3,4]','$[1]','$[2]')

