Hi all,

thanks for the great feedback.

On 26/05/11 19:26, Sean Copenhaver wrote:
Have you tried having a map function that emits the 'a_name' as a key then a
reduce function that uses the builtin sum(), then you query with group=true?

If I do:

emit([a_name, one_id, another_id, created_at]);

I can query it with (reduce just being the built in _count)

group=true&group_level=1

and by that get the dictionary I wanted:

{
 "Lisa" : 1
 "John" : 3
}

I know need to make the start and endkey parameters ignore the first element of my key as a_name is not a search parameter. I've tried with this search for one_id=1, another_id=2 and date between 2011-05-26 and 2011-05-27:

startkey=[{},1,2,"2011-05-26"]&endkey=[{},1,2,"2011-05-27"]

But don't get anything returned. Am I doing this wrong? Is there a different way to make the view ignore the first element of the key? In the coucdb.log I can see that my query parameters enter Couch the way I intended (no BASH escaping going astray).

Cheers,

-Torstein

Reply via email to