Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 18994 invoked from network); 18 Jul 2010 23:12:33 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Jul 2010 23:12:33 -0000 Received: (qmail 21948 invoked by uid 500); 18 Jul 2010 23:12:32 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 21886 invoked by uid 500); 18 Jul 2010 23:12:32 -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 21878 invoked by uid 99); 18 Jul 2010 23:12:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Jul 2010 23:12:31 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of steven.prentice.87@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Jul 2010 23:12:24 +0000 Received: by iwn8 with SMTP id 8so3236515iwn.11 for ; Sun, 18 Jul 2010 16:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=O28eWssCYVbGIixwUzW5hceCcQHo+Pdj64wG6jEidk4=; b=hrevnJ4T0q3YenWt3MsRLM2nLaVYZrR17zzj509k3c96THvlXLzFMAu6jrxT0Yjhak CM4X22KJAN8ECt9ts22ksW8J/4hk1GjE4ZCjruMzzaDxiAcjNBjjRnuaCXfk19LHssQM qxg0AJ585DEthsJ96mWtd23kAPiJMfTg8fuAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=IjKivoiBnAudqaSrEdAAhgJrgtLGTgt35clk++criX8oAN5NrhV8kWettfrf2LHwHq YbqI6fOyfejFi/5C4etjpYYFdKGBdbIjwJhci+xntD3ptsosstr92kGCvzxhyul5nr7f 3bcbn9uPgtUDO07L8FYFVAdYoCrrBdHbDlPgc= MIME-Version: 1.0 Received: by 10.231.157.195 with SMTP id c3mr4839040ibx.155.1279494722741; Sun, 18 Jul 2010 16:12:02 -0700 (PDT) Received: by 10.231.114.196 with HTTP; Sun, 18 Jul 2010 16:12:02 -0700 (PDT) Date: Mon, 19 Jul 2010 09:12:02 +1000 Message-ID: Subject: using req.query to filter a list function in couchDB 0.10.0 From: Steven Prentice To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=00504501601670e768048bb194be X-Virus-Checked: Checked by ClamAV on apache.org --00504501601670e768048bb194be Content-Type: text/plain; charset=ISO-8859-1 Hi, I am trying to use a list function to filter the results of a view in my database. I have developed the following code, but keep getting a reference error when making a request: Request = curl -X GET '..../_design/dates/_list/param/audit_resource_subresource_with_criteria?as="TestUser"' (param is the name of my list function) the function looks like this...what I am trying to do is allow someone to enter the name of the user to filter the view for just rows where the accessingsystem field = what is entered: function(head, req) { var accessingsystem = req.query['as']; var row; while(row = getRow()) { if (as && row.value[1] != as) { continue; } send(row.value); } } the error i get is {"code":500,"error":"render_error","reason":"function raised error: ReferenceError: as is not defined"} any help = much appreciated! Steve --00504501601670e768048bb194be--