before.update doc is old doc before updates? Or is doc the new doc as will be saved?
opened this issue · comments
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?
Answer: use LocalCollection
from minimongo
:
LocalCollection._modify(doc, modifier)
That modifies the doc in place, and then we can perform checks on it's new modified state.
Yep... #91 (comment)