Going through all responses, so I'm sure there's another answer further down.

Noah, this doesn't work since it sorts by 'key'. I want the top 10
sorted by 'value'. In other words I want the result to be:

{ key: "b", value: 12 },
{ key: "a", value: 10 },
{ key: "c", value: 1 }

and so on.

K.

On Tue, Sep 30, 2008 at 6:26 PM, Noah Tye <[EMAIL PROTECTED]> wrote:
> On Tue, Sep 30, 2008 at 5:54 PM, kowsik <[EMAIL PROTECTED]> 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".
>
> --
> ''=~('(?{'.('/))./@'^'_[@@[`').'"'.('./](@{"[^'^'`@<@`/[>|').',$/})')
> [EMAIL PROTECTED] | 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."
>

Reply via email to