So I have the following documents in a collection.
{
_id: "1",
quantity: 0,
array: [{name: "test1a", quantity: 10}, {name: "test1a", quantity: 1}, {name: "test1b", quantity: 10}, {name: "test1c", quantity: 1}]
}
{
_id: "2",
quantity: 0,
array: [{name: "test2a", quantity: 10}, {name: "test2b", quantity: 10}, {name: "test2c", quantity: 1}]
}
{
_id: "3",
quantity: 0,
array: [{name: "test3a", quantity: 10}, {name: "test3b", quantity: 10}, {name: "test3c", quantity: 1}]
}
What I wanted was to query all documents in the collection whose it's array contains objects with name = "test1a" and update those object quantity property with a new value.
