incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: _rev for random view???
Date Wed, 04 Feb 2009 20:41:25 GMT
On Wed, Feb 4, 2009 at 3:18 PM, Chris Anderson <jchris@apache.org> wrote:
> On Wed, Feb 4, 2009 at 11:15 AM, Troy Kruthoff <tkruthoff@blit.com> wrote:
>>
>> Anyone have thoughts on the best way to create a view of random documents?
>>  I'm thinking a view with emit(doc._rev,null) would be sufficient for my
>> needs, but thought I'd ping the list for collective knowledge ;)
>>
>
> I'm not sure how _rev works for randomness.
>
> Math.random()
>

Though you should *NEVER* use Math.random() in a view. Not sure if
it's even in the sandbox, but just in case.

> works fine.
>
>
> --
> Chris Anderson
> http://jchris.mfdz.com
>

Mime
View raw message