Meteor-Community-Packages / meteor-collection-hooks

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

Please clarify that findOne hook will be called when using update #191

Closed jonlachlan closed 8 years ago

jonlachlan commented 8 years ago

I had no idea that findOne hook ran when performing an update. It was not at all apparent to me that findOne would be involved with update. I think it would make sense to indicate this in the docs.

matb33 commented 8 years ago

To be fair, this is what Meteor also does: https://github.com/meteor/meteor/blob/abd574f38008b45f5e2a6bc322b10bcdde44763a/packages/mongo/collection.js#L144

jonlachlan commented 8 years ago

Yep, that's totally fair, and I don't have a problem with the behavior, I just think it should be documented, especially in the context of running hooks which could have side effects. In vanilla Meteor/Mongo, how it is implemented makes no difference to me as a developer, but in this context it was a pitfall.