couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Devon Weller <>
Subject Re: Sorting items by number of votes
Date Thu, 05 Nov 2009 19:51:05 GMT

Thanks Nathan, Daniel and others.  Those are some good suggestions and  

I think I may need to rethink my design and just put the votes in an  
array belonging to the resource document.

As for the aggregate sum example in the wiki, I still think it might  
be broken.  I'm starting another thread with details about that in a  
separate email.

- Devon

On Nov 5, 2009, at 12:53 PM, Nathan Stott wrote:

> Right now I'm using lists to do 'joins' of my multi-doc-type views.

On Nov 5, 2009, at 11:43 AM, Daniel Truemper wrote:

> You could however write another type of document (VoteCount) into  
> your database containing the resource and the number of votes. Then  
> emitting as key something like [ #votes, resource ] will give you an  
> ordered view based on the number of votes. You could trigger the  
> view update from the client each time a vote is made (i.e. add a  
> vote document, call the view, update the VoteCount document and call  
> the new view to get the ordered votes). You could also do this  
> automatically on the CouchDB using update notifiers and simple Bash/ 
> Python/Perl/whatever scripts...

View raw message