以下是我的數據庫架構更新操作:如何在MongoDB中更新數組中對象的多屬性值?
db.school_student.update({ _id: "003" }, {
$set: {
"result": [
{
"_id": "001",
"isPassed": false
},
{
"_id": "002",
"isPassed": false,
},
{
"_id": "003",
"isPassed": false
}
]
}
});
我想改變ALL的"isPassed"
的屬性值true
。有什麼方法可以更新嗎?我一直在這個掙扎了整整一天:(
你能告訴蒙戈數據庫文檔也 – Webdev