Meteor-Community-Packages / meteor-collection-hooks

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

How do we validate docs in an upsert? #168

Closed trusktr closed 8 years ago

trusktr commented 8 years ago

I'm making my own custom validation logic (i.e. not using collection2, etc). I can easily validate documents on .before.insert and .before.update by checking the document, then simply returning false if validation fails.

But with .before.upsert the handler function doesn't have a doc arg. How might I be able to validate the documents added or the document inserted in an upsert?

ghost commented 8 years ago

@matb33?

ghost commented 8 years ago

Solved: https://github.com/matb33/meteor-collection-hooks/issues/169#issuecomment-193050902