I am trying to update the value of an object in an array of my mongodb schema using mongoose and nodejs.
My model is :
{
"_id": ObjectId("557eecd687cff9281040efe5"),
"products": [
{
"productId": "6849500",
"qty": 2,
"_id": ObjectId("557eef13101aef4c101af513")
}
]
}
I would like to update the "products" array "qty" value filtering on "productId"