update data in sequelize
const objectToUpdate = { title: 'Hello World', description: 'Hello World' } models.Locale.update(objectToUpdate, { where: { id: 2}})
Source: stackoverflow.com
update data in sequelize
const objectToUpdate = { title: 'Hello World', description: 'Hello World' } models.Locale.findAll({ where: { title: 'Hello World'}}).then((result) => { if(result){ // Result is array because we have used findAll. We can use findOne as well if you want one row and update that. result[0].set(objectToUpdate); result[0].save(); // This is a promise } })
Source: stackoverflow.com