incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject Re: Selecting part of a multi-value key
Date Mon, 22 Feb 2010 10:51:24 GMT
On Sun, Feb 21, 2010 at 02:04:57PM -0800, David Van Couvering wrote:
> I have a view that generates a type and a date as a composite key.  This way
> the results are sorted by type and then by date.

That is, something like  emit([doc.type,doc.date], ...)   ?

> I would like to call the view so that I get all rows that match a given
> type, regardless of date.  I need them sorted by date.

startkey=["a_type"]&endkey=["a_type",{}]

(with suitable URL encoding). They will still be sorted by date, because
they are sorted by [type,date].

For reduce values for all rows with a particular type, look at group_level=1

Mime
View raw message