Thanks Aurélien for a better explanation of my problem :-)

On Sun, Oct 5, 2014 at 1:01 PM, Aurélien Bénel <aurelien.be...@utt.fr>
wrote:

> >> I need to filter by date and group by group...
> > You can use the second with group_level=1 and get all the groups at the
> same time. And you can use _count
>
>
> I'm afraid this is not so easy...
> Using a filter by date will also *group* by date.
>
> Let's take a very simple example...
>
> Here are keys emitted by a map:
> [2012, 'A']
> [2012, 'B']
> [2012, 'C']
> [2013, 'A']
> [2013, 'A']
> [2013, 'A']
> [2013, 'C']
> [2014, 'A']
> [2014, 'A']
> [2014, 'B']
>
> If we query it with `_count` as the reduce function, `group=true`,
> `startkey=[2013]` and `endkey=[2014,{}]`, we'll get:
> [2013, 'A'] -> 3
> [2013, 'C'] -> 1
> [2014, 'A']      -> 2
> [2014, 'B'] -> 1
>
> Boaz will need additional computation to get:
> 'A' -> 5
> 'B' -> 1
> 'C' -> 1
>
>
> Regards,
>
> Aurélien

Reply via email to