Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 81293 invoked from network); 28 Jun 2010 13:30:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jun 2010 13:30:03 -0000 Received: (qmail 92586 invoked by uid 500); 28 Jun 2010 13:30:02 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 92351 invoked by uid 500); 28 Jun 2010 13:29:59 -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 92342 invoked by uid 99); 28 Jun 2010 13:29:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 13:29:58 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [212.27.42.1] (HELO smtp1-g21.free.fr) (212.27.42.1) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 13:29:49 +0000 Received: from zimbra5-e1.priv.proxad.net (unknown [172.20.243.155]) by smtp1-g21.free.fr (Postfix) with ESMTP id 7A65F940106 for ; Mon, 28 Jun 2010 15:29:23 +0200 (CEST) Date: Mon, 28 Jun 2010 15:29:17 +0200 (CEST) From: mickael.bailly@free.fr To: user@couchdb.apache.org Message-ID: <396506980.1696591277731757277.JavaMail.root@zimbra5-e1.priv.proxad.net> In-Reply-To: <2105158520.1693781277731197288.JavaMail.root@zimbra5-e1.priv.proxad.net> Subject: selecting a random subset of a view MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.30.182.129,192.54.145.194] X-Mailer: Zimbra 5.0 (ZimbraWebClient - SAF3 (Win)/5.0.15_GA_2815.UBUNTU8_64) X-Authenticated-User: mickael.bailly@free.fr X-Virus-Checked: Checked by ClamAV on apache.org Hello couchers, how would you do to select a random subset of a view result (a simple view with map only). Example (I don't write the full view response array for clarity) When called normally, my view returns : { ... rows: [ {id: aa1}, {id: aa2}, {id: aa3}, {id: aa4}, {id: aa5}, {id: aa6}, {id: aa7}, {id: aa8}, {id: aa9} ] } And I want only three of those rows, randomly chosen. So I launch the magic "get three random rows" feature, and it gives me : { ... rows: [ {id: aa5}, {id: aa3}, {id: aa6} ] } The second time I launch the same magic "get three random rows" I got: { ... rows: [ {id: aa7}, {id: aa1}, {id: aa5} ] } Thanks for your advices Mickael