How can I compute the aggregate of the following metrics without knowing all the metrics before hand? Can I accomplish this using the aggregate framework or MapReduce?
You can try below aggregation.
Convert the object into array of key value pairs followed by $unwind+$group to group by each key and accumulate the count. Final step to go back to named key value object.
db.colname.aggregate([
{"$addFields":{"metrics":{"$objectToArray":"$metrics"}}},
{"$unwind":"$metrics"},
{"$group":{
"_id":{"id":"$player_id","key":"$metrics.k"},
"count":{"$sum":"$metrics.v"}
}},
{"$group":{
"_id":"$_id.id",
"metrics":{"$mergeObjects":{"$arrayToObject":[[["$_id.key","$count"]]]}}
}}
])