Arrow function "this" scope used as callback UserSchema.pre(string,callback) in User Model
Opened this issue · 0 comments
EdgarMC100 commented
Should be changed to function(){} because "this" points to global scope, not function scope in arrow functions. In this case use function(){} instead