for (var id in update.changed_data) {
for (var sub_id in update.changed_data[id]) {
db.collection.update({ "_id" : update._id, "$atomic" : "true" },{ $set: {'events.' + update.event_id + '.'+ id +'.' + sub_id : update.changed_data[id][sub_id] } });
}
}
Puoi anche controllare questo URL:http://www.mongodb.org/ display/DOCS/Updating#Updating-ModifierOperations