对我有用的是:
db.collection.find({ _id: ObjectId('4d2d8deff4e6c1d71fc29a07') })
.forEach(function (doc) {
doc.events.forEach(function (event) {
if (event.profile === 10) {
event.handled=0;
}
});
db.collection.save(doc);
});
我认为对于mongo新手和熟悉JQuery&friends的任何人来说,这一点都比较清楚。