Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 74933 invoked from network); 1 Aug 2008 17:46:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2008 17:46:16 -0000 Received: (qmail 71944 invoked by uid 500); 1 Aug 2008 17:46:15 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 71632 invoked by uid 500); 1 Aug 2008 17:46:14 -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 71621 invoked by uid 99); 1 Aug 2008 17:46:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 10:46:14 -0700 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.233.166.183] (HELO py-out-1112.google.com) (64.233.166.183) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 17:45:20 +0000 Received: by py-out-1112.google.com with SMTP id u52so542416pyb.13 for ; Fri, 01 Aug 2008 10:45:45 -0700 (PDT) Received: by 10.115.32.1 with SMTP id k1mr11975941waj.107.1217612745112; Fri, 01 Aug 2008 10:45:45 -0700 (PDT) Received: by 10.114.254.4 with HTTP; Fri, 1 Aug 2008 10:45:45 -0700 (PDT) Message-ID: <64a10fff0808011045s1fbf0dfwe486e209c165cd7d@mail.gmail.com> Date: Fri, 1 Aug 2008 13:45:45 -0400 From: "Dean Landolt" To: couchdb-user@incubator.apache.org Subject: Re: API within view code In-Reply-To: <4aa4f4d60808011017q6ae92b2bj92204c28ac524dd5@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7616_7836936.1217612745097" References: <4aa4f4d60808011017q6ae92b2bj92204c28ac524dd5@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_7616_7836936.1217612745097 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > What's the API available within the scope of the view code? Do I have > anything else besides the pure JavaScript API? If you're asking is there any way you can write views, there is -- I've played around with python views in Chris Lenz's beautiful couchdb-python library. I've read the python views are quite a bit slower, but I've been working with tiny datasets so far so I wouldn't know. If you're asking whether you can talk to couch or tinker with the internals in the view code, I don't know for sure, but I doubt it. In order to get the benefit of instant reads once the view indexes are built, the only data that can really matter to the view is data from documents themselves -- otherwise couch wouldn't know how to incrementally update the views... But I could be wrong (and kinda hope I am)... > I noticed there is a > "main.js", should I add any utility functions I wish there? I think that's the idea. Also, can I share some state between "map" calls or pass external parameters > to it besides the default "doc" parameter? While I also find myself yearning for a way to get at a view from another view, you might want to watch your language -- I think "*share some state*" is a curse word to the functional programmers among us ;) ------=_Part_7616_7836936.1217612745097--