Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 88160 invoked from network); 22 May 2008 04:08:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 May 2008 04:08:11 -0000 Received: (qmail 34325 invoked by uid 500); 22 May 2008 04:08:12 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 34290 invoked by uid 500); 22 May 2008 04:08:12 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 34266 invoked by uid 99); 22 May 2008 04:08:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2008 21:08:12 -0700 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 209.85.146.181 as permitted sender) Received: from [209.85.146.181] (HELO wa-out-1112.google.com) (209.85.146.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 May 2008 04:07:24 +0000 Received: by wa-out-1112.google.com with SMTP id m16so3255217waf.6 for ; Wed, 21 May 2008 21:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=UWC1apP167G+Es1PBIQ8R+Vcm6k457BUoScC8On6/Lo=; b=AfLQxntfGmQrlfCaURTWu56v0YEJt/vY9opwIzq6V82alutm0e2ST1QF07fjmMuTmaZQqjz5wBHSL0tPojN5/7kIhgJmh1WLnfms5LB/d6yIn02Y1qmIwHjuH25Q3nhl26UuOlNIZxokv4GzWJ6TCOucriK9m4e7BpoamKYPHjo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=KrdLCWHBeBfq5p6Zw64hKOm6s/wSN90blXeHezlUtN6dZjX8XD5qEF9EenZC0OvQOu0GHHGETOTtwqr/DDWgMWomgoNh9s7VfzhKg8ZDXBGPpnGtzH+5+UaadROFDV7eVv4fSNT+k2GoHYl3Dgptn9yAZCQpKhq0IjlnZTkW79s= Received: by 10.114.135.1 with SMTP id i1mr11514922wad.88.1211429259688; Wed, 21 May 2008 21:07:39 -0700 (PDT) Received: by 10.114.102.7 with HTTP; Wed, 21 May 2008 21:07:39 -0700 (PDT) Message-ID: Date: Wed, 21 May 2008 21:07:39 -0700 From: "Chris Anderson" Sender: jchris@gmail.com To: couchdb-user@incubator.apache.org Subject: Re: Changes in trunk In-Reply-To: <8A150DFE-97BB-41D5-82D4-04D15B34ECFB@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8A150DFE-97BB-41D5-82D4-04D15B34ECFB@apache.org> X-Google-Sender-Auth: 4ff35a21b165ce46 X-Virus-Checked: Checked by ClamAV on apache.org These are good changes, and it's important to have the same API for views and temp views. Question: are there plans to allow access to the results of the map stage of a map/reduce pair? It would certainly be helpful for debugging, and I can imagine circumstances where one might want to use both of them in an application, while avoiding the overhead of duplicate map functions. Further over the horizon I imagine sharing maps among reduce functions - maybe the reduce key could optionally support an array of reduce functions, rather than just the string. Looking forward to specifying start and end keys for the reductions, so we can really see what they can do! Chris On Wed, May 21, 2008 at 11:08 AM, Jan Lehnardt wrote: > Dear CouchDB aficionados, > we made a couple of changes in trunk that are > not backward compatible with earlier versions > of CouchDB. Theses are necessary changes > and we do them now in preparation for an 0.8 > release. > > If you have software that uses CouchDB, it is > likely to require changing. Sorry about that :-) > > The changes in detail: > > Views now support optional reduce. For this > to work, the structure of view documents > had to change. An example is probably the > best way to illustrate them: > > { > "_id":"_design/foo", > "language":"javascript", > "views": { > "bar": { > "map":"function... ", > "reduce":"function..." > } > } > } > > Notable changes are the usage of a JSON object > to define both the map and the reduce function instead > of just a string for the map function. Again, the reduce > member may be omitted. > > The "language" member is no longer a "proper" > MIME-Type, instead, only the actual language's > name is stated. > > Confusingly, we used a "map()" function to be used > within the actual map function (or view function) to > place a key and value in a view's result list. This > function is now called "emit()" to avoid confusion. > > function(doc) { > emit(doc.foo, null); > } > > Temporary views now need to get POSTed a > proper JSON document with map and reduce > members instead of just posting in the map function's > source: > > { > "map":"function...", > "reduce":"function..." > } > > Note that the language of the view functions is no > longer determined by the Content-Type header of > the HTTP request. Since the definition is a JSON object, > the Content-Type is always application/json. > > { > "language":"javascript" > "map":"function...", > "reduce":"function..." > } > > > You specify the language of the temp view in an optional > "language" member. If omitted, it's value defaults to > "javascript". > > > > -- Chris Anderson http://jchris.mfdz.com