Say I have a map that emits the following objects
{"basePoints": 2000, "bonusPoints": 1000}
{"basePoints": 1000, "bonusPoints": 50}
{"basePoints": 10000, "bonusPoints": 5000}
How could I write a reduce in Erlang (not javascript) that would return an aggregate object like this:
{"basePoints": 13000, "bonusPoints": 6050}
(I would rather not have to write 2 separate views that emits each value separately if I can help it)
Many Thanks!