Answers for "update json_set key base mysql"

1

mysql json change key

UPDATE `my_table` 
SET `my_col` = JSON_INSERT(
                           JSON_REMOVE(my_col, '$.oldKeyValue'), 
                           '$.newKeyValue', 
                           JSON_EXTRACT(my_col, '$.oldKeyValue')
                          );
Posted by: Guest on June-07-2020
0

how to update json key name while keeping the values in mysql

UPDATE `my_table` 
SET `my_col` = JSON_INSERT(
                           JSON_REMOVE(my_col, '$.oldKeyValue'), 
                           '$.newKeyValue', 
                           JSON_EXTRACT(my_col, '$.oldKeyValue')
                          );
Posted by: Guest on November-05-2020

Code answers related to "update json_set key base mysql"

Code answers related to "Javascript"

Browse Popular Code Answers by Language