mangusta pobiera wartość db na haku przed zapisaniem
Chcę wiedzieć, jaka jest „czysta” wartość brudnego rekwizytu w pre-save mongoose hook:
UserSchema.pre('save', function(next) {
var user = this;
if (user.isModified('password')){
//i want to know what the value of user.password was before it was changed
}
next()
}
Czy możliwe jest wyszukanie starej wartości bez szukania jej w db?