【发布时间】:2013-08-14 02:35:08
【问题描述】:
我想知道在这样的预保存猫鼬钩子中脏道具的“干净”值是什么:
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()
}
是否可以在不查找数据库的情况下查找旧值?
【问题讨论】: