-1
I’m trying to run a validation process for a field in the Mongoose schema. However, the behavior of the variable "this" is different than expected. Because according to the documentation in: http://mongoosejs.com/docs/validation.html#update-validators-and-this, should refer to the object of the model being saved. However, when debugging in Vscode the reference Local to this is correct, but the reference indicated by the "Watcher" is another, the reference of the module class. Can anyone tell me why this is happening? How to access the correct reference in this context?