The official API documentation suggests using it Model.updateas follows:
Model.update
var gid = ...; var uid = ...; var values = { gid: gid }; var where = { uid: uid }; myModel.update(values, where) .then(function() { // update callback });
But this gives me: "Missing, where the attribute in the parameter parameter is passed for updating." The documents also mention that this use is deprecated. Seeing this error, I think they have already changed it. What am I doing wrong?
, . , where Model.update API Model.update where, :
where
var gid = ...; var uid = ...; var values = { gid: gid }; var selector = { where: { uid: uid } }; myModel.update(values, selector) .then(function() { // update callback });
!
:
( ). Model.update docs.sequelize.com. , options.where ( []).
options.where
, where . :
await DisplayMediaSequence.update({ default: false }, { where: {}, // <--- here transaction }); await DisplayMediaSequence.update({ default: true }, { where: { id }, transaction });