Reduce a view's reduce?


#1

Hello! I need reduce the results of view (?).
My view returns something like this:

{“rows”:[
{“key”:[1,71],“value”:1},
{“key”:[1,10222],“value”:3},
{“key”:[1,12897],“value”:3},
{“key”:[1,13193],“value”:1},
{“key”:[1,25493],“value”:1},
{“key”:[1,29991],“value”:1},
{“key”:[1,38808],“value”:1},
{“key”:[1,38998],“value”:2},
{“key”:[1,41604],“value”:2},
{“key”:[1,42425],“value”:1},
{“key”:[2,10550],“value”:2},
{“key”:[2,12907],“value”:2},
{“key”:[2,13193],“value”:3},
{“key”:[2,15441],“value”:1},
{“key”:[2,20412],“value”:2},
{“key”:[2,20582],“value”:2},
{“key”:[2,26722],“value”:2},
{“key”:[2,27954],“value”:6},
{“key”:[2,28095],“value”:1},
{“key”:[2,28105],“value”:1},
{“key”:[2,29801],“value”:3},
{“key”:[2,32148],“value”:3},
{“key”:[2,44067],“value”:2},
{“key”:[2,45963],“value”:2},
{“key”:[3,553],“value”:1}

This view returns the total hits in a category by an user,
Example

{“key”:[1,71],“value”:1}, - Category 1 was beaten 1 time for user 71
{“key”:[1,10222],“value”:3}, - Category 1 was beaten 3 times for user 10222
{“key”:[5,71],“value”:6}, Category 5 was beaten 6 times for user 71
etc…

What i need now is get the unique hits in a category
Example:

{“key”:[1,71],“value”:1},
{“key”:[1,10222],“value”:3},
{“key”:[1,12897],“value”:3},
{“key”:[1,13193],“value”:1},
{“key”:[1,25493],“value”:1},
{“key”:[1,29991],“value”:1},
{“key”:[1,38808],“value”:1},
{“key”:[1,38998],“value”:2},
{“key”:[1,41604],“value”:2},
{“key”:[1,42425],“value”:1},
Category 1 was beaten 10 uniques times (over a total 16 times)

How i can do it? Should i do it in client side (will i have performance issues, itering over millions results)?