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

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 "how to update json key name while keeping the values in mysql"

Code answers related to "Javascript"

Browse Popular Code Answers by Language