From user-return-3339-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Feb 04 20:42:04 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 37522 invoked from network); 4 Feb 2009 20:41:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2009 20:41:59 -0000 Received: (qmail 97410 invoked by uid 500); 4 Feb 2009 20:41:56 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 97363 invoked by uid 500); 4 Feb 2009 20:41:56 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 96920 invoked by uid 99); 4 Feb 2009 20:41:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 12:41:54 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.198.229 as permitted sender) Received: from [209.85.198.229] (HELO rv-out-0506.google.com) (209.85.198.229) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Feb 2009 20:41:45 +0000 Received: by rv-out-0506.google.com with SMTP id g9so2173357rvb.3 for ; Wed, 04 Feb 2009 12:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=0IwKaQKjJMQUPZUWUvY3VbOCtfUeopW1uF15FxCDiTg=; b=Aya7Qjuz11Z42Rvh59jkGH1WtbGqVBW535L2pGg/ZZRwNlQjyzKVGLG0NuznncFg7t 7oiK6PDab23M81zzIQb1FXVWqaOCrJHNKdTDeNVzLvfJL9EUpQ5+oPAsEgcNUHBYNcXQ ooYxQfnJ0QF9h/iYkkS5G+AA14D8Kj5DTEIhM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=iqueBWZZNX+s2ifWEjlaqJTmnHiUcJwTGlJucrD6HMJgeeFrJHMZaH1/HMmdF4O8I9 MlVV8Za1UtHOTQfF0XitO3CA1yFlcSTo6twKiGzR5/Fi3oNZj7ff2UcPxLGVbS2CNEAe t5REFafO2VjMuhF80gC9ETSVIJTSqvvCWqp4A= MIME-Version: 1.0 Received: by 10.141.82.20 with SMTP id j20mr1678216rvl.54.1233780085294; Wed, 04 Feb 2009 12:41:25 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Feb 2009 15:41:25 -0500 Message-ID: Subject: Re: _rev for random view??? From: Paul Davis To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Feb 4, 2009 at 3:18 PM, Chris Anderson wrote: > On Wed, Feb 4, 2009 at 11:15 AM, Troy Kruthoff 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 >