In exploring ways to do real-time analytics with MongoDB, there seems to be a fairly standard way to do sums, but nothing in terms of more complex aggregation. Some things that
There is work planned for the upcoming 1.9.x unstable release that may have aggregations.
See: https://jira.mongodb.org/browse/SERVER-447
Of course, it may get bumepd to a later release/