I am using
schema.pre('save', function (next) {
if (this.isModified('field')) {
//do something
}
});
but I now need to use this same function isModified
in a schema.pre('update'
hook, but it does not exists. Does anyone know how I can use this same functionality in the update
hook?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…