Sunday, 1 September 2019

Mongo/ Mongoose How to update many if a field value is in an array I have

Its pretty simple. Say I have a collection of documents of people, and each document has "name, weight, age". Also, say I have an array of "ages" (or any field). How do I tell mongoose to update every document's "weight" by adding 50 to the current value, IF the "age" in the document is in my array of "ages" ? Im using Node.

Submitted September 02, 2019 at 03:52AM by StreamPanel

No comments:

Post a Comment