Closed ghost closed 8 years ago
I'd like to validate doc on before.update, but apparently doc is the old doc before the modifier is applied to it. How do we validate the new doc?
doc
before.update
modifier
Answer: use LocalCollection from minimongo:
LocalCollection
minimongo
LocalCollection._modify(doc, modifier)
That modifies the doc in place, and then we can perform checks on it's new modified state.
Yep... https://github.com/matb33/meteor-collection-hooks/issues/91#issuecomment-85007712
I'd like to validate
doc
onbefore.update
, but apparentlydoc
is the olddoc
before themodifier
is applied to it. How do we validate the new doc?