couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: Order posts by most recently commented on?
Date Thu, 25 Feb 2010 00:12:41 GMT

On Feb 24, 2010, at 3:34 PM, Travis LaDuke wrote:

> I need to list topics in order of when they were last replied to
> (commented on) instead of when the topic was created. You know how a
> forum works. I can't figure out any combination of map/reduce/list
> that works. Is it possible?

You could add a "lastCommentDate" property to each topic's document,  
and update it whenever you add a comment. You'll need to resolve  
conflicts if you try to update the date but someone else just updated  
it before you did.

View raw message