couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <...@jsonified.com>
Subject Re: CouchDB: Return Results in Random Order
Date Tue, 22 Oct 2013 13:22:51 GMT
On 22. Oktober 2013 at 14:29:16, Hank Knight (hknight555@gmail.com) wrote:
>
>This returns 10 results:
>http://localhost:5984/mydb/_design/type/_view/q?limit=10&key=%22xyz%22
>
>Is there a way for the results to be returned in random order?

As Bob says, no, but you can fake it. see http://blog.chewxy.com/2012/11/16/random-documents-from-couchdb/
basically you either do it at view build time, and rebuild periodically, or do it at query
time http://sea-krait.blogspot.co.at/2011/03/cleaner-pseudo-randomized-views-in.html by abusing
limits and skips.

A+ 
Dave Cottlehuber
Sent with Airmail

Mime
View raw message