sequelize.js deep save/update model instance


You need to call update on the instance of the db model:

for eg: 
const address= {
"addressInfo": {
        "permanent": {
            "district": "Morang",
            "city": "Biratnagar",
            "wardNo": "03",
            "toleName": "Gaurigunj"
        },
        "current": {
            "district": "Kathmandu",
            "city": "Lazimpat",
            "wardNo": "02",
            "toleName": "Thamel"
        }
    },
};
to update  district of permanent object call
await address.addressInfo.permanent.update({
  district:"dolakha",
});

Comments

Popular posts from this blog

Motor Driving Training Center in Charikot Dolakha