Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 28370 invoked from network); 10 Jan 2009 19:52:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jan 2009 19:52:13 -0000 Received: (qmail 73958 invoked by uid 500); 10 Jan 2009 19:52:11 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 73922 invoked by uid 500); 10 Jan 2009 19:52:11 -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 73911 invoked by uid 99); 10 Jan 2009 19:52:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jan 2009 11:52:11 -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 jchris@gmail.com designates 74.125.44.29 as permitted sender) Received: from [74.125.44.29] (HELO yx-out-2324.google.com) (74.125.44.29) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Jan 2009 19:52:03 +0000 Received: by yx-out-2324.google.com with SMTP id 3so2985297yxj.5 for ; Sat, 10 Jan 2009 11:51:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=yfR8GuerX5CLdGC0DIPnkrqcRfymiYI/4daeWHGV9cA=; b=pynWcEfwjdW5O99efckcQZ7FdbKnOWBhyrjZUm0nZqPo8YS7asSDkmUiVf2w7xpxEh YxUiCxJZUj//2Q8dW1MHDj4lSlk9LHaiwS7IvrtRfVkbVA2TMOSXGYldp/ffNUKRjoNL /t2oBSCBEd/G19IP1OBvva/99iA8layhFMrgY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=BzVh4XQSXp5ui+NWJmZm+pTvCPcK/zisv13YlGItQrFdw2ZEqNaDikTZU+3c4iyge8 I/GxtPZhJsONGb410MbfJ0ksPPr0oAzXvrEBDCK4El4L7FzZDrVuutrxytgVVgxQFv0l 2jFZlJ+oNsCrvRwCdluxGs8dIAhxbjTGX+DqE= Received: by 10.65.158.9 with SMTP id k9mr18801913qbo.34.1231617102265; Sat, 10 Jan 2009 11:51:42 -0800 (PST) Received: by 10.65.181.8 with HTTP; Sat, 10 Jan 2009 11:51:42 -0800 (PST) Message-ID: Date: Sat, 10 Jan 2009 11:51:42 -0800 From: "Chris Anderson" To: user@couchdb.apache.org Subject: Re: View configuration In-Reply-To: <9dc90f170901101120j77fb60d0x891cda087d89da2f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9dc90f170901101120j77fb60d0x891cda087d89da2f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Jan 10, 2009 at 11:20 AM, Thomas Williams wrote: > Hi chaps,I've spent a couple of days playing around with version 0.80 and I > think I might be missing something. Is it possible to configure views at > query time or do they have to always be effectively 'static'. I mean can I > write a view something like this: > > function(doc, user_id) { > if(doc.user_id=user_id) > emit(doc) > } > > Then pass user_id as a parameter to each query. If not, does anyone know how > I can go about retrieving data based on a unique key in an efficient manner? > Views must be pure functions from the doc alone (no other data). The way to build you query is described at http://wiki.apache.org/couchdb/View_Snippets -- Chris Anderson http://jchris.mfdz.com