Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 19085 invoked from network); 18 Sep 2009 03:44:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Sep 2009 03:44:48 -0000 Received: (qmail 6883 invoked by uid 500); 18 Sep 2009 03:44:47 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 6711 invoked by uid 500); 18 Sep 2009 03:44:47 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 6701 invoked by uid 99); 18 Sep 2009 03:44:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Sep 2009 03:44:46 +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 jchris@gmail.com designates 209.85.212.171 as permitted sender) Received: from [209.85.212.171] (HELO mail-vw0-f171.google.com) (209.85.212.171) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Sep 2009 03:44:37 +0000 Received: by vws1 with SMTP id 1so686860vws.13 for ; Thu, 17 Sep 2009 20:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=za44koXREFoMnb0fOLGagob4pw0rFFqwKZf5ypFAUCo=; b=nEyVbq1Ts+3KW8sdx6Nx4lDMkC2jVBthzxBrT8wNV+3NKrlFsvOa/Gb0JSW39smksS g72bf9wQYyttnNh8gnURMFSemZjBvd/X8b75tSCMvyqOI3lWyFMeRUKBSt/NeYJDemQX kemPXL13F87lHZqz+jfHJBolHWUcyJTS6CM+0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=uTjo+jbzgPRTNb68UrfWvbXvPDwc6UhQlFTYwsYX0iPtpwKgl78pfjgaMe0Pomb0hN bE2yVdveV/w5cJcTagSsGW99OG0AR1K0eh6TH8V9btk4V00r6bYDhYxpcRdUkZoZRIHX px5NUBWG6OlApLhmVyRZkVGq4Kwj+GatMesfY= MIME-Version: 1.0 Sender: jchris@gmail.com Received: by 10.220.112.204 with SMTP id x12mr563817vcp.19.1253245456085; Thu, 17 Sep 2009 20:44:16 -0700 (PDT) In-Reply-To: References: <20090916220419.9719923888D7@eris.apache.org> <9764C7A3-E05E-4A1A-9505-8329BD1AE1A3@gmail.com> Date: Thu, 17 Sep 2009 20:44:16 -0700 X-Google-Sender-Auth: d6defab341850007 Message-ID: Subject: Re: Its not a JOIN (was Re: svn commit: r815984 - in /couchdb/trunk: share/www/script/test/view_include_docs.js src/couchdb/couch_httpd_db.erl src/couchdb/couch_httpd_view.erl) From: Chris Anderson To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Sep 17, 2009 at 4:33 PM, Paul Davis wrote: >> I guess what I'm saying is that I think the include doc "pointer" >> belongs in the value, not in some other place. It strikes me as >> exactly what emitted values are for, to hold arbitrary data associated >> with the key. > > By assigning implicit behavior based on the value, its no longer > arbitrary. _rev and now _id are restricted in what they can represent. > For instance, what happens if I emit {"_id": true} with > include_docs=true? > > Think of the third value as a "row options" variable. The two concepts > are basically "We make assumptions about what you wanted based on what > you emit" or "We make no assumptions. You must be precise in what you > want". Being precise is important because it keeps the concept-API > simpler, easier to remember, and easier to reason about. > > It may seem trivial at this point, but what if we add a feature for > following keys instead of id's? And then what if we allow a row to > stop traversal in a breadth first search scheme? Putting these into an > "options variable" makes more sense to me because the concept is that > they affect how the row is interpreted by the server vs what the row > represents to the client. > > Granted that's just the purist argument and it doesn't really mean > anything until there's an implementation. So until someone gives it a > go and puts a patch in JIRA there's no reason to change the current > behavior. I just don't want any future contributors to think this > isn't an idea worth pursuing. > > Paul Davis > I can see the argument now that you describe future features we might build in this manner. However, I still think it's generally OK to muck around in the value namespace, and I wouldn't be opposed to reserving the _ namespace in view values (but I don't think it's necessary). We don't need to be very formal here. If someone is writing a view to take advantage of include_docs special features (or key following, or other future features) they will be able to write their view around the feature implementation. So for hypothetical future instance, if you absolutely must have a view with row values that look like {"_stop":true}, and you don't want to trigger the stop-iteration, then simply don't query the view with ?stop_on_stop=true. If you plan to use the (hypothetical) stop iterator feature, then it's up to you to only have "_stop" : true in your value when you mean it. I don't think this is a big deal, as you'll be writing the map functions around these features anyway, so you can always envelope anything: eg {"my_real_data":{"_stop":true}, "_stop" : false}. The bigger question is philosophical. I generally tend to recoil from the purist argument, because once you start to go down that road you face a danger of lots of implementation (and API) complexity for very little practical benefit. I'm not saying I'd vote against a patch here, but I think energy could be put to better use. Chris -- Chris Anderson http://jchrisa.net http://couch.io