Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

updating json object in mysql database

SET @data = '{  
    "Person": {    
       "Name": "Homer", 
       "Hobbies": ["Eating", "Sleeping"]  
    }
 }';
SELECT JSON_SET(@data, '$.Person.Name', 'Bart', '$.Person.Hobbies[1]', "Mischief") AS 'Result';
Source by database.guide #
 
PREVIOUS NEXT
Tagged: #updating #json #object #mysql #database
ADD COMMENT
Topic
Name
4+2 =