Meteor-Community-Packages / meteor-collection-hooks

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

Hooks are not fired for aggregation #217

Closed lijoantony closed 7 years ago

lijoantony commented 7 years ago

I am filtering out some data in find/findOne queries with the help of hooks, for security purposes. I found that find hooks are not fired during an aggregate operation (via meteor-aggregate pkg). Is this the expected behaviour? Is there a work around to achieve the same? If it is a missing feature, is there a plan to support the same in future?

zimme commented 7 years ago

Yes, there's nothing we can do about that because Collection.aggregate is bound to rawCollection which is the collection representation created by the mongodb node driver.

We are just working with the Meteor abstraction of the collections. Which is on a layer higher up than the rawCollection.