Answer the question
In order to leave comments, you need to log in
How to update subdocument in mongoose as comfortably as document?
There is a function: Model.findByIdAndUpdate(id, updateObject)
But it updates the main document. How easy is it to update a subdocument? So that without $set, immediately submit an array of updates and he updated everything himself.
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