Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E25697CAB for ; Thu, 6 Oct 2011 23:53:15 +0000 (UTC) Received: (qmail 83446 invoked by uid 500); 6 Oct 2011 23:53:14 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 83412 invoked by uid 500); 6 Oct 2011 23:53:14 -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 83404 invoked by uid 99); 6 Oct 2011 23:53:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 23:53:14 +0000 X-ASF-Spam-Status: No, hits=-0.6 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pulpfree1@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 23:53:07 +0000 Received: by eya25 with SMTP id 25so341835eya.11 for ; Thu, 06 Oct 2011 16:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=gPyAhfK/9FE+uqnT3Ur5+FD9/33b2oDPnNaH6m5euIs=; b=fY1Ap2w6cPCTbwwlLie1VnDsQHGsBg2PL3iZal3hmuJ8gm9l9Ib1wjjRxIiNDxTN1A EFx++sRjCVepqOw/HcahW0LYvdOTkMgCSIAgysYxxGSP2162LVh5xEB1ZC2gUA6y3GCf 2qfw9qNXDCmOe7N5aEPwabKex6AH/LKpXCNYs= MIME-Version: 1.0 Received: by 10.223.77.69 with SMTP id f5mr6736599fak.3.1317945166281; Thu, 06 Oct 2011 16:52:46 -0700 (PDT) Received: by 10.223.107.65 with HTTP; Thu, 6 Oct 2011 16:52:46 -0700 (PDT) In-Reply-To: References: Date: Thu, 6 Oct 2011 19:52:46 -0400 Message-ID: Subject: Re: query parameters in Update Handler functions From: Ron Dyck To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Yup single quotes like so ?'foo=3Dbar&baz=3Dfaz' works fine. Thanks for the help! ron On Thu, Oct 6, 2011 at 7:20 PM, Robert Newson wrote: > & is a shell metacharacter causing curl to run in the background. > Everything after it is ignored. > > try; > > curl -vX PUT 'http://localhost:5984//_design//_update= /test-qparams/?foo=3Dbar&baz=3Dfaz' > > B. > > On 7 October 2011 00:08, Ron Dyck wrote: >> I think it must be how I was using curl, discovered it was not a >> problem within my php application. >> Thanks for the help. Am curious what I'm doing wrong with curl though. >> >> Here's my curl statement: >> curl -vX PUT http://localhost:5984//_design//_update= /test-qparams/?foo=3Dbar&baz=3Dfaz >> >> On Thu, Oct 6, 2011 at 5:26 PM, Ryan Ramage wrot= e: >>> Works for me on 1.1 =A0are you on a recent couch? >>> Maybe this might help you debug: >>> >>> function(doc, req) { >>> =A0 =A0 =A0 =A0var resp =3D =A0{ >>> =A0 =A0 =A0 =A0 =A0 =A0headers : { >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 'Content-Type' : 'application/json' >>> =A0 =A0 =A0 =A0 =A0 =A0}, >>> =A0 =A0 =A0 =A0 =A0 =A0 body : JSON.stringify(req.query) >>> =A0 =A0 =A0 =A0}; >>> =A0 =A0 =A0 =A0return [null, resp]; >>> } >>> >>> On Thu, Oct 6, 2011 at 2:11 PM, Ron Dyck wrote: >>>> I was attempting to use the=A0"in-place" Update Handler function and r= an >>>> into an issue with the number of query parameters. After copying the >>>> function from the test suite to ensure I had the proper code, I found >>>> that I was only able to use the first of the query parameters. >>>> >>>> The documentation shows the example: >>>> http://127.0.0.1:5984//_design//_update/in-= place/?field=3Dtitle&value=3Dtest >>>> In my testing, (after replacing with proper values, I >>>> was unable to read the last param 'value'. >>>> >>>> Here's my code: >>>> "in-place": "(function (doc, req) {var field =3D req.query.field; var >>>> value =3D req.query.value; var message =3D 'set ' + field + ' to ' + >>>> value; doc[field] =3D value; return [doc, message];})", >>>> >>>> The value of req.query.field is good. >>>> >>>> Your help is appreciated. >>>> >>>> ron >>>> -- >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> Ron Dyck >>>> pulpfree1@gmail.com >>>> www.webbtech.net >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> >>> >> >> >> >> -- >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> Ron Dyck >> pulpfree1@gmail.com >> www.webbtech.net >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> > --=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Ron Dyck pulpfree1@gmail.com www.webbtech.net =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D