-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"this" is {} #154
Comments
Arrow functions / lambdas cannot work for schema functions (middleware, methods, etc...). Lambdas lexically bind |
Hi, this is the output I am getting:
It also does not generate id attribute with UUID! |
schema.pre('save', next => {
console.log(this);
if (!this.metadata) {
this.metadata = {}
}
var now = new Date();
})
with this code I am getting "this" is like empty object {}
The text was updated successfully, but these errors were encountered: