incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Ramage <ryan.ram...@gmail.com>
Subject Re: query parameters in Update Handler functions
Date Thu, 06 Oct 2011 21:26:55 GMT
Works for me on 1.1  are you on a recent couch?
Maybe this might help you debug:

function(doc, req) {
	var resp =  {
            headers : {
               'Content-Type' : 'application/json'
            },
             body : JSON.stringify(req.query)
        };
	return [null, resp];
}

On Thu, Oct 6, 2011 at 2:11 PM, Ron Dyck <pulpfree1@gmail.com> wrote:
> I was attempting to use theĀ "in-place" Update Handler function and ran
> 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/<my_database>/_design/<my_designdoc>/_update/in-place/<mydocId>?field=title&value=test
> In my testing, (after replacing <placeholder> with proper values, I
> was unable to read the last param 'value'.
>
> Here's my code:
> "in-place": "(function (doc, req) {var field = req.query.field; var
> value = req.query.value; var message = 'set ' + field + ' to ' +
> value; doc[field] = value; return [doc, message];})",
>
> The value of req.query.field is good.
>
> Your help is appreciated.
>
> ron
> --
> =================
> Ron Dyck
> pulpfree1@gmail.com
> www.webbtech.net
> =================
>

Mime
View raw message