King
King

Reputation: 2538

Toggle a boolean column with sequelize

I want to toggle a particular column with type boolean in postgres using sequelize. I do not want to use the sequelize.query() option, yet, I want it done in one call. Is this possible?

Upvotes: 1

Views: 3159

Answers (1)

Mktj
Mktj

Reputation: 41

You can use Sequelize.literal

model.update({ name: Sequelize.literal('NOT name') }, { where: { id } });

Upvotes: 4

Related Questions