不要怂,就是干,撸起袖子干!

Commit b196273b by Andy Edwards Committed by Sushant

docs(hooks.md): add warning about memory limits of individual hooks (#9881)

1 parent 31ee6a7b
Showing with 2 additions and 0 deletions
...@@ -212,6 +212,8 @@ afterBulkDestroy(options) ...@@ -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. 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 ```js
Model.destroy({ where: {accessLevel: 0}, individualHooks: true}); 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 // Will select all records that are about to be deleted and emit before- + after- Destroy on each instance
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!