Reputation: 98
According to official doc Incrementing certain values of an instance.
We can increment values of an instance.
But why can not we call increment
by Sequelize
directly?
Upvotes: 1
Views: 360
Reputation: 19581
Because it's an Instance's method and not a model's method.
You can use something like :
someModel.update( { clicks : sequelize.literal( "clicks + 1" ) } ) )
if you want to increment all instances in a model.
Upvotes: 2