couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: _rev for random view???
Date Wed, 04 Feb 2009 21:38:36 GMT

On 4 Feb 2009, at 21:18, Chris Anderson 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.


couch_db.erl:                 
Doc#doc{revs=[list_to_binary(integer_to_list(couch_util:rand32())) |  
Revs]}

Cheers
Jan
--

Mime
View raw message