incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Woodward <>
Subject Re: First doc in a group?
Date Thu, 11 Nov 2010 21:11:15 GMT
On Thu, Nov 11, 2010 at 12:59 PM, Mike Bannister <>wrote:

> 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?

I'm pretty new to CouchDB as well so take this for what it's worth--in one
of our databases we needed to get the most recent document based on a
timestamp, so we just have a view called "byDate" with the key being the
timestamp, and then we just call the view like this:

Not sure that's quite what you're after and might not address the user part
of what you're doing, but hope that helps a bit.

Matthew Woodward / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.

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