Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 1129 invoked from network); 23 Apr 2009 17:00:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Apr 2009 17:00:04 -0000 Received: (qmail 14869 invoked by uid 500); 23 Apr 2009 17:00:03 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 14788 invoked by uid 500); 23 Apr 2009 17:00:03 -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 14778 invoked by uid 99); 23 Apr 2009 17:00:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2009 17:00:03 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.217.162] (HELO mail-gx0-f162.google.com) (209.85.217.162) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Apr 2009 16:59:57 +0000 Received: by gxk6 with SMTP id 6so1325431gxk.11 for ; Thu, 23 Apr 2009 09:59:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.187.19 with SMTP id k19mr411720wff.271.1240505975416; Thu, 23 Apr 2009 09:59:35 -0700 (PDT) In-Reply-To: <46aeb24f0904230933u1a9bad32r9dfdb073c768a11a@mail.gmail.com> References: <1d3db2990904230838r34a4c060t5ae305e67145a285@mail.gmail.com> <46aeb24f0904230933u1a9bad32r9dfdb073c768a11a@mail.gmail.com> Date: Thu, 23 Apr 2009 09:59:35 -0700 Message-ID: <1d3db2990904230959q24530cbat420cee8688f53490@mail.gmail.com> Subject: Re: how to do http request within server-side _show or _view functions? From: Samuel Wan To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks. What about validate_doc_update? My goal was to check a hashed key in the document submitted by a user by comparing the key with a stored document when the validate_doc_update is called. -Sam On Thu, Apr 23, 2009 at 9:33 AM, Robert Newson wrote: > I was just reading this (at > http://wiki.apache.org/couchdb/Formatting_with_Show_and_List); > > "Show and list functions are side effect free and idempotent. *They > can not make additional HTTP requests against CouchDB*. Their purpose > is to render JSON documents in other formats." > > So they can't, and it's intentional. > > B. > > On Thu, Apr 23, 2009 at 4:38 PM, Samuel Wan wrote: >> Is there a way to do an http request within the server-side _show or >> _view functions, or is the JS context limited to what's defined by >> Spidermonkey and main.js? My understanding is that Spidermonkey >> doesn't provide an xmlhttprequest object. >> >> Also, does CouchDB ship with an interactive javascript shell, or do >> you have to build and install your own? I found the couchjs >> executable, but it only interprets javascript files. >> >> -Sam >> >