Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mysql json change key

UPDATE `my_table` 
SET `my_col` = JSON_INSERT(
                           JSON_REMOVE(my_col, '$.oldKeyValue'), 
                           '$.newKeyValue', 
                           JSON_EXTRACT(my_col, '$.oldKeyValue')
                          );
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #json #change #key
ADD COMMENT
Topic
Name
8+5 =