U
U
Urukhayy2017-12-02 15:13:31
MongoDB
Urukhayy, 2017-12-02 15:13:31

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 question

Ask a Question

731 491 924 answers to any question