Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 65271 invoked from network); 11 Jan 2011 07:49:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jan 2011 07:49:20 -0000 Received: (qmail 61160 invoked by uid 500); 11 Jan 2011 07:49:19 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 60818 invoked by uid 500); 11 Jan 2011 07:49:16 -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 60806 invoked by uid 99); 11 Jan 2011 07:49:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jan 2011 07:49:15 +0000 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 acunningham@integrics.com designates 194.145.196.78 as permitted sender) Received: from [194.145.196.78] (HELO puffin.integrics.com) (194.145.196.78) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Jan 2011 07:49:10 +0000 Received: from [85.154.243.83] (helo=[192.168.1.3]) by puffin.integrics.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1PcYyG-0006zP-MG for user@couchdb.apache.org; Tue, 11 Jan 2011 07:48:48 +0000 Message-ID: <4D2C0B5E.1050706@integrics.com> Date: Tue, 11 Jan 2011 11:48:46 +0400 From: Alistair Cunningham User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: Views with variable parameters References: <4D2BFFBF.7000303@integrics.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thank you, that's perfect! Alistair Cunningham +1 888 468 3111 +44 20 799 39 799 http://integrics.com/ On 11/01/11 11:11, kowsik wrote: > In your design/view, say 'blah/foo', do this: > > emit([ doc.field1, doc.field2 ], null) > > And when you query: > > GET /db/_design/blah/_view/foo?key=["abc","def"] > > Hope that helps, > > K. > --- > http://www.pcapr.net > http://twitter.com > http://labs.mudynamics.com > > On Mon, Jan 10, 2011 at 10:59 PM, Alistair Cunningham > wrote: >> Hello all, >> >> Is there an efficient way to implement a view that does the equivalent of >> this SQL? >> >> select * from documents where field1='abc' and field2='def'; >> >> where 'abc' and 'def' are different for every query? It needs to be fast and >> scalable on large data sets (millions of documents). >> >> -- >> Alistair Cunningham >> +1 888 468 3111 >> +44 20 799 39 799 >> http://integrics.com/ >>