Closed nodesocket closed 7 years ago
I guess what you mean is that the hook is called twice when you save a document. There's one validation happening before saving, and one after on retrieve.
So that's working as intended.
How then do I only have the hook called before saving? Is that possible.
Using the
Model.post('validate'
hook with a custom function, I noticed it is being called twice when invoked with a singlenew Model
.You'll see the
console.log()
twice.