node.js - How to update a whole record in sequelize (not just single field) -
i know how update particular field in sequalize
project.update( { title: 'a new value' }, { where: {id: 1} }) .success(function () { }) .error(function () { } );
however, update whole row of values/fields.
{ "field1":"foo", "field2":"bar", "field3":"bar2" }
the documentation on website not clear : http://docs.sequelizejs.com/en/latest/api/model/
just pass object new data first parameter update function
project.update( { title: 'a new value', field1: "foo", field2: "bar" }, { where: {id: 1} })
Comments
Post a Comment