I have a collection named products in which I want to update the code which have the empty field under options.stores.code structure is as follow:-
{
"_id": ObjectId(),
"sku": "V4696-DR-V33",
"options": [
{
"sku": "8903689984338",
"stores": [
{
"code": "AND1",
"zipcode": "110070",
"inventory": -5000
},
{
"code": "AND2",
"zipcode": "201010",
"inventory": -5000
},
{
"code": "AND3",
"zipcode": "411001",
"inventory": -5000
},
{
"code": "AND4",
"zipcode": " 700020",
"inventory": -5000
}
],
},
{
"sku": "1742564789",
"stores": [
{
"code": "AND1",
"zipcode": "110070",
"inventory": -5000
},
{
"code": "AND2",
"zipcode": "201010",
"inventory": -5000
},
{
"code": "AND3",
"zipcode": "411001",
"inventory": -5000
},
{
"code": "AND8",
"zipcode": " 700020",
"inventory": -5000
}
],
},
]
}
Want to update the inventory, which have the same code.