couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <>
Subject Re: reduce_limit error
Date Tue, 18 Aug 2009 09:50:54 GMT
On Sun, Aug 16, 2009 at 11:18:32AM -0700, Chris Anderson wrote:
> you should never accumulate a list in a reduce function...

He's not. He's just returning a single document, which is the one with the
largest value of created_at.

IMO that's a pretty reasonable thing to do, because it's not unbounded
expansion: the largest reduce value will be the largest single document in
the database. Note that we explicitly say it's OK to emit an entire document
as a value in a k/v index, i.e. emit(null, doc), and his reduce function is
just picking one of those 'values'.



View raw message