I am trying to delete all my records from a table using sequelize but saw that there are two possible functions to use: queryInterface.bulkDelete
and queryInterface.destroy
. Can someone tell me what are the differences between these two and which one should I use? The documentation does not do a great job apparently.
Asked
Active
Viewed 527 times
0

tnkh
- 1,749
- 2
- 14
- 30
-
1Is it queryInterface.destroy? Are you sure about that? Because as I know, destroy is a method for model instaces. Which removes the instace from DB. queryInterface.bulkDelete is sending a new query to remove more than one data from DB – Mansur Jun 25 '20 at 07:54
-
What version of sequelize are you using? There is no `destroy` method on `QueryInterface` – Lin Du Dec 04 '20 at 06:28