To destroy or delete all records in the table with Node Sequelize, we call the destroy
method.
For instance, we write
db.User.destroy({
where: {},
truncate: true,
});
to call destroy
to destroy the table linked to the User
model.
We set truncate
to true
to remove all the data in it.