Mongo DB集合
{
findId: xyz,
mainArray:[{
andFindThisObjectId:abc,
pushInThisArray:[{newValue,anotherValue}}
}]
}
所以我想在 pushInThisArray 字段中找到并推动更多价值
答案 0 :(得分:0)
db.collection.update({
$and:[{"findId":"BL0303160"},
{"mainArray._id":ObjectId("56d7a674af6cb08406f3bf8a")}
]},
{$push:{
"mainArray.$.pushInThisArray":
{"myName":"Pratik",
"myPc":"HP"}
}});