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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -