incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Iriele <siriele...@gmail.com>
Subject Re: CouchDB: Return Results in Random Order
Date Tue, 22 Oct 2013 17:52:37 GMT
What are you trying to randomize?
On Oct 22, 2013 6:23 AM, "Dave Cottlehuber" <dch@jsonified.com> wrote:

> 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.htmlby abusing
limits and skips.
>
> A+
> Dave Cottlehuber
> Sent with Airmail
>

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