Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

Support modifying selector for insert/update/remove #40

Closed npvn closed 10 years ago

npvn commented 10 years ago

I'm curious why we can modify the selector for find/findOne, but not for insert/update/remove.

mizzao commented 10 years ago

@npvn hooks for update and remove happen at the document level and not the selector level. If you take a look at the code, you'll see that the find operation is run first to get the set of matching documents, and then hooks called for each one.

npvn commented 10 years ago

Got it. Thank you very much!