couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Rakotojaona <>
Subject Re: Hitting reduce_limit with "good" reduce function
Date Thu, 11 Apr 2013 18:56:17 GMT
On 04/11, Michael Jackson wrote:
> My use case is that I've got a bunch of user documents and a bunch of
> timestamps of when we last saw that user. When I fetch the user doc, I'd
> like to also have present the timestamp when that user was last seen. I may
> just be greedy wanting to do this all in one query, but I'll be running
> this query very frequently so I'd like to optimize this case.

According to your use case, you could return the user doc and the
timestamp as two separated fields but in the same response, instead of
building a brand new doc on each rereduce step. The doc will be
transported as-is from rereduce to rereduce, only the last_seen argument
will be changed until all the timestamps are processed.

Matthieu Rakotojaona

View raw message