I'm confused. Mongoose allows us to use methods update, findOneAndUpdate... etc however when passing through a middleware like pre('findOneAndUpdate') we only have access to the query. For example, the isModified method isn't available.
How am I supposed to encrypt a password field if changed and edit a timestamp in the model if anything else changed?
via Apyn AOM
No comments:
Post a Comment