Answer the question
In order to leave comments, you need to log in
Mongoose - why is the middleware not responding when data is updated?
I send a PUT request. On the server, the document is searched for by ID and updated. After the scheme, I catch it as follows:
UserSchema.pre('save', async function (next) {
....
});
update
and findOneAndUpdate
- the result is the same. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question