Manuel
Manuel

Reputation: 9522

Sequelize How to save without changing updatedAt?

Is it anyhow possible to NOT update the updatedAt value on sequelize model.save()?

I'm incrementing counters of an object and do not update the model at its root, thus I'd like the updatedAt value to stay as it is. Is this anyhow possible with sequelize?

Upvotes: 3

Views: 1446

Answers (1)

piotrbienias
piotrbienias

Reputation: 7411

You need to perform

instance.save ({ silent: true })

Adding this prevents changing the updatedAt value. Read save options

Upvotes: 9

Related Questions