Skip to content

Commit

Permalink
docs(hooks.md): add warning about memory limits of individual hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Sep 5, 2018
1 parent 342e18f commit 72d9886
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/hooks.md
Expand Up @@ -212,6 +212,8 @@ afterBulkDestroy(options)

If you want to emit hooks for each individual record, along with the bulk hooks you can pass `individualHooks: true` to the call.

**WARNING**: if you use individual hooks, *all instances that are updated or destroyed will get loaded into memory* before your hooks are called. The number of instances Sequelize can handle with individual hooks is limited by available memory.

```js
Model.destroy({ where: {accessLevel: 0}, individualHooks: true});
// Will select all records that are about to be deleted and emit before- + after- Destroy on each instance
Expand Down

0 comments on commit 72d9886

Please sign in to comment.