couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noah Tye" <n...@tyes.us>
Subject Re: Top 10 sorted by value...
Date Wed, 01 Oct 2008 01:26:39 GMT
On Tue, Sep 30, 2008 at 5:54 PM, kowsik <kowsik@gmail.com> wrote:
> I have a data set where my map reduce returns data like so:
>
> { key: "a", value: 10 },
> { key: "b", value: 12 },
> { key: "c", value: 1 },
> ...
>
> Potentially this could be fairly large, even after the reduce. Is
> there any way to:
>
> 1. sort these by descending values? I only want the top 10.

count=10

> 2. page through them in the sorted order?

startkey=<wherever you want to start>

Take a look at <http://wiki.apache.org/couchdb/HttpViewApi>, in the
section "Querying Options".

-- 
''=~('(?{'.('/))./@'^'_[@@[`').'"'.('./](@{"[^'^'`@<@`/[>|').',$/})')
noah@tyes.us | http://noah.tyes.us
"They copied all they could follow, but they couldn't copy my mind,
And I left 'em sweating and stealing a year and a half behind."

Mime
View raw message