What you have looks almost correct. The last step should be to create a new field that computes the ratio from what nb_broken and total.
db.collection.aggregate([ { $group: { _id: {'rank': '$rank', 'components': '$components'}, total: {$sum: 1}, nb_broken: { $sum: {$cond: [{$eq: ['$broken', true]}, 1, 0] } } }, }, { $project: { _id: 1, brokenRatio: { $multiply:[{ $divide: ["$nb_broken", "$total"]}, 100] } } } ])
My favorite is definitely humongous.io. They will certainly support v3 of mongoDB since they're web-based. But I don't really plan on upgrading my prod BD on mongoDB 3.0 anytime soon. I haven't taken a look at the release changes yet, but besides changes to the way it works internally, is there going to be any major API changes ?