The doc.isModified(
) and doc.modifiedPaths()
functions doesn't work with the Schema.post('findOneAndUpdate')
, I'm trying to return the new updated object but the problem doesn't solved!
UserSchema.post('findOneAndUpdate',function(doc){
console.log(doc.isModified());
})