http://stackoverflow.com/questions/4621300/how-i-can-sum-all-the-values-of-a-key-in-a-collection-in-mongodb
http://www.letrails.cn/archives/add-sum-method-for-mongo-mapper/
http://www.letrails.cn/archives/add-sum-method-for-mongo-mapper/
db.testmap.save({"id":1,"max":2.2,})
map = function() { emit("sum", this.max); }
red = function(k, v) { var i, sum = 0;for (i in v) {sum += v[i];} return sum;}
res = db.testmap.mapReduce(map, red);
db[res.result].find()