我想知道一个脏的道具的"干净"值在这样的预先保存的猫鼬钩子中是什么:
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()
}
Run Code Online (Sandbox Code Playgroud)
是否可以查找旧值而无需在数据库中查找?