Categories
JavaScript Answers

How to delete items with Sequelize.js?

Spread the love

Sometimes, we want to delete items with Sequelize.js.

In this article, we’ll look at how to delete items with Sequelize.js.

How to delete items with Sequelize.js?

To delete items with Sequelize.js, we can use the destroy method.

For instance, we write

Model.destroy({
  where: {
    // ...
  }
})

to call Model.destroy with an object that has the where property to specify which items we want to delete.

Conclusion

To delete items with Sequelize.js, we can use the destroy method.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *