couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson" <>
Subject Re: view access keeps timing out
Date Thu, 11 Sep 2008 05:08:19 GMT
On Wed, Sep 10, 2008 at 7:25 PM, william kinney
<> wrote:
> reduce function:
> function(keys, values) {
>  return values;
> }

The problem is with your reduce function (and the existing
documentation for reduce, which should make this clear, but doesn't).

Reduce should only be used to emit scalar values. In your case, you
would be better not to define a reduce function at all, and just query
the map with startkey and endkey ranges. For example reduce functions,
see couch_tests.js's reduce test here:

There are also some examples in various blog posts I've written about reduce:

Google search for those posts:

Hope this helps!


Chris Anderson

View raw message