MongoDB中精确元素数组中的更新字段
{ _id:"43434", heroes : [ { nickname : "test", items : ["", "", ""] }, { nickname : "test2", items : ["", "", ""] }, ]}
$set
items
heros
nickname
"test"
?
结果:
{ _id:"43434", heroes : [ { nickname : "test", items : ["", "new_value", ""] }, // modified here { nickname : "test2", items : ["", "", ""] }, ]}
白猪掌柜的
杨魅力
相关分类