Closed AlexeyKhristov closed 8 years ago
there is no way to get access to model instance inside extended validator. opposite to mongoose validation
http://mongoosejs.com/docs/validation.html, 'Update Validators and this' section
this refers to the document being validated when using document validation. However, when running update validators, the document being updated may not be in the server's memory, so by default the value of this is not defined.
PS: all tests passed
👍 Would you mind adding a test or two to confirm that the model instance is retained?
test added
Thanks 👍
there is no way to get access to model instance inside extended validator. opposite to mongoose validation
http://mongoosejs.com/docs/validation.html, 'Update Validators and this' section
PS: all tests passed