mongodb php finding a subobject and removing it, $inc other subobject
- by Mark
I'm trying to delete the subobject 'apples' from my documents and update the 'fruitInventory' property, decrease by the amount of apples.
I'm confused on how to proceed, should I use dot notation or do a full text search for apples? I don't know if this matters but you can assume apples will always be in field 1.
// Document 1
{
"1": {
…