Hi. I'm trying to use the middleware to add a default value, based on another document, in the pre validate event (not pre save because without this element the validation will fail).
I tried to do so, following the official mongoose documentation, but so far I failed.
I created a stackoverflow question about it but nothing useful yet so I'm asking here, hoping to be pointed out on the good direction.
Thanks.