2

I am using sequelize with mysql and i am trying to update a column which is of JSON type. I specifically want to update a particular key in the JSON. Here is what I have tried till now.

Profile.update(
        values,
      {
        where: {
          id : id
       }
    }).then(function(obj) {
       ...
    }.catch(function(err){
       ...
    })

It removes the entire value and updates the new value. I want to just update that particular key alone. The content of values is,

{
    "details"{ 
        name : "user"
    }
}

details is the field i want to update and name is the key to update. I couldn't find any helpful resource for this with sequelize. Thanks in advance.

arvind
  • 778
  • 1
  • 9
  • 16

0 Answers0