javascript - Sequelize, how do I get current value of updating row? -


how current value of row i'm update? have findone query before update, in order find previous value? here's want do:
update usermodels set nonce = nonce + 1 u_id = 1

is there way make work here? how [current value of nonce]? have separate query?

return usermodels.update({         nonce: [current value of nonce] + 1     },{         where: {             u_id: 1         }     } ); 

as docs say, updated value of object should retrieved again. @lj_1102 commented this link here on api implementation can see better explanation.

refer reload if cant reload instance , prevent creating again


Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -