Meteor-Community-Packages / meteor-collection-hooks

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

Is there any way to make a global hook/callback? #99

Closed Lepozepo closed 9 years ago

Lepozepo commented 9 years ago

Is there any way to make a global collection hook that runs whenever any collection inserts/updates/removes? Thanks in advance!

matb33 commented 9 years ago

Unfortunately not... interesting use case though. I can certainly see it being handy if you know for sure you need createdAt/modifiedAt across the board. Is that what you had in mind?

Lepozepo commented 9 years ago

My use case is adding a company ID. So basically I have users that belong to a company and anything they create belongs to the company. I currently have collection2 identify the company and add it per collection but I'm repeating that same snippet for every collection schema I make

mizzao commented 9 years ago

Not sure if this package would help, but it sounds relevant for you: https://github.com/mizzao/meteor-partitioner

Lepozepo commented 9 years ago

That's a pretty interesting solution ^_^