You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ryszard Szopa <ry...@gmail.com> on 2008/06/10 23:49:51 UTC

grouping results by keys

Hi,

Right now some quite basic things are rather difficult in CouchDB. For
example, if we had a database with car objects that have brands and
models, there's no straightforward way of finding all the different
car models or brands. This could become very simple if there was a
possibility of grouping results by keys. This could be implemented in
the following way:

* View-objects could have an additional attribute, "group", which
would contain a function taking two arguments: a key and a list of
values
* After the map phase, the "group" function would be called on each
different key and the list of objects that had this key
* The reduce phase would be done after the group phase.

This could also work very well with view collation.

Cheers,

    -- Richard

PS. Please forgive me being that guy that asks for new features all the time...

-- 
http://szopa.tasak.gda.pl/

Re: grouping results by keys

Posted by Ryszard Szopa <ry...@gmail.com>.
On Tue, Jun 10, 2008 at 11:49 PM, Ryszard Szopa <ry...@gmail.com> wrote:
> Hi,
>
> Right now some quite basic things are rather difficult in CouchDB. For
[...]
> This could also work very well with view collation.

OK, so now I'd become the guy that asks for existing features... I've
just noticed group and group_level and group couch_httpd.erl.

Please forget about my last e-mail.

    -- Richard

-- 
http://szopa.tasak.gda.pl/