incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filippo Fadda <filippo.fa...@programmazione.it>
Subject Re: Get the 20 posts, of the last seven days, ordered by number of hits
Date Mon, 22 Jul 2013 17:32:02 GMT
OK, this answered to my question:

http://stackoverflow.com/questions/5571459/couchdb-view-query-with-multiple-key-values

It is never possible to query by criteria A and then sort by criteria B in CouchDB.

So I have to get posts in a data range, then sort them by number of hits myself.

-Filippo



On Jul 22, 2013, at 6:25 PM, Filippo Fadda wrote:

> Let's suppose I have a blog and I want display the popular posts, where popular means:
the 20 posts, of the last seven days, ordered by number of hits.
> To avoid conflicts I don't save the number of hits in the post itself, but I emit a new
document every time a generic user displays a post.
> Even using view collation I don't get a solution for this problem.
> 
> -Filippo


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