Answer the question
In order to leave comments, you need to log in
How to access this model?
Question in the comments to the code
var UserSchema = new Schema({
// Email пользователя
email: {
type: String,
required: true,
unique: true
},
........................................
// API KEY
apikey: {
type: String,
required: true,
// Как получить доступ к полю email из функции default?
default: function(){
return SHA512(this.email).toString().to(50); // this.email не возвращает Email пользователя. Он у всех одинаковый получается.
}
},
........................................
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question