This is not possible with views. Such processing would best be done at the client side (and is partly due to the map-reduce nature of views. Views are executed on different nodes, each having access to only a subset of the documents).
What you want may be possible using N1QL, though.