read up on the `group` and `group_level` params as well: http://wiki.apache.org/couchdb/Introduction_to_CouchDB_views#Grouping