以下是我的一個收集響應,wan't從以下收集更新庫存值..想要更新二級數組對象MongoDB中
{
"_id": ObjectId(),
"sku": "V4696-DR-V33",
"options": [
{
"sku": "8903689984338",
"stores": [
{
"code": "AND1",
"zipcode": "110070",
"id" : 101010,
"inventory": 12
},
{
"code": "AND2",
"zipcode": "201010",
"id" : 101010,
"inventory": 10
}
],
"price": 2199,
"_id": ObjectId(),
"size": "14"
},
{
"sku": "1742564789",
"stores": [
{
"code": "AND1",
"zipcode": "110070",
"id" : 101010,
"inventory": 21
},
{
"code": "AND2",
"zipcode": "201010",
"id" : 101010,
"inventory": 20
}
],
"price": 2199,
"_id": ObjectId(),
"size": "16"
},
]
}
要更新所有存貨價值爲0,那麼應該怎麼得做..? 想要的任何簡單或單蒙戈查詢來更新我的所有文件..
感謝您爲我提供這個信息..這對我真的很有幫助... –