couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Bannister <>
Subject First doc in a group?
Date Thu, 11 Nov 2010 20:59:56 GMT
Hi all, I'm a new user and have made some strides in understanding The
CouchDB Way. I've come to a piece of my project that I'm unsure how to
handle, I would greatly appreciate any nudging in the right direction that
people can offer.

I have a set of documents that are related to users in my system and each
document has a timestamp. What's the CouchDB way of getting the latest
document for each user? Right now I'm going through each user and then
selecting their latest doc using limit/start_key parameters to query the
view. Is there a crafty map function solution to this problem or should I be
thinking about a reduce function to somehow get rid of the docs I don't

Thanks, I think understanding this will be very helpful to me generally.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message