I don't think this is possible with just one HTTP fetch and / or without additional logic in your own code.
If you are emit([time, name]) , you can query startkey=[timeA]&endkey=[timeB]&group_level=2 to get the elements between timeA and timeB grouped, where their timestamp and name were identical. You can then post-process this to compose them when the names match, but the original result set may be larger than you want to process.
An alternative would be emit([name,time]) . You can then query first with group_level=1 to get a list of names [if your application does not already know what they will be]. Then, for each of them, you request startkey=[nameN]&endkey=[nameN,{}]&group_level=2 to get a summary for each name.
(Note that in my sample requests, I left unencrypted JSON start / end keys to make them more human readable, but you need to apply your equivalent JavaScript encodeURIComponent to them in actual use.)
source share