MongoDB中精确元素数组中的更新字段
{
_id:"43434",
heroes : [
{ nickname : "test", items : ["", "", ""] },
{ nickname : "test2", items : ["", "", ""] },
]}$setitemsherosnickname "test" ?
结果:
{
_id:"43434",
heroes : [
{ nickname : "test", items : ["", "new_value", ""] }, // modified here
{ nickname : "test2", items : ["", "", ""] },
]}
汪汪一只猫
白猪掌柜的
杨魅力
随时随地看视频慕课网APP
相关分类