You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Pulkit Singhal <pu...@gmail.com> on 2013/03/21 00:56:18 UTC

How to pass id as a query parameter to an Update Handler

How can I pass the document id to an update handler via a browser request?
I've tried:
http://127.0.0.1:5984/
<my_database>/_design/<my_designdoc>/_update/in-place-query/<mydocId>
http://127.0.0.1:5984/
<my_database>/_design/<my_designdoc>/_update/in-place-query?id=<mydocId>
http://127.0.0.1:5984/
<my_database>/_design/<my_designdoc>/_update/in-place-query?_id=<mydocId>

But I never receive a non-nil document in my update handler.

What am I doing wrong?

Re: How to pass id as a query parameter to an Update Handler

Posted by Nils Breunese <n....@vpro.nl>.
Pulkit Singhal <pu...@gmail.com> wrote:

> How can I pass the document id to an update handler via a browser request?
> I've tried:
> http://127.0.0.1:5984/
> <my_database>/_design/<my_designdoc>/_update/in-place-query/<mydocId>
> http://127.0.0.1:5984/
> <my_database>/_design/<my_designdoc>/_update/in-place-query?id=<mydocId>
> http://127.0.0.1:5984/
> <my_database>/_design/<my_designdoc>/_update/in-place-query?_id=<mydocId>
> 
> But I never receive a non-nil document in my update handler.
> 
> What am I doing wrong?

Does http://wiki.apache.org/couchdb/Document_Update_Handlers help?

Nils.

Re: How to pass id as a query parameter to an Update Handler

Posted by Pulkit Singhal <pu...@gmail.com>.
Thanks for validating, it really helped to know which was the right one.
I had an incorrect trailing character in my id value. Fixed now :)

On Wed, Mar 20, 2013 at 5:00 PM, Jeff Charette <io...@yahoo.com> wrote:

> First one is correct.  Check your design doc has the update handler.  Also
> make sure you are doing a post.
>
> Jeff Charette | Principal
> We Are Charette
> web / identity / packaging
>
> m  415.298.2707
> w  wearecharette.com
> e   jeffrey@wearecharette.com
>
> On Mar 20, 2013, at 7:56 PM, Pulkit Singhal <pu...@gmail.com>
> wrote:
>
> > How can I pass the document id to an update handler via a browser
> request?
> > I've tried:
> > http://127.0.0.1:5984/
> > <my_database>/_design/<my_designdoc>/_update/in-place-query/<mydocId>
> > http://127.0.0.1:5984/
> > <my_database>/_design/<my_designdoc>/_update/in-place-query?id=<mydocId>
> > http://127.0.0.1:5984/
> > <my_database>/_design/<my_designdoc>/_update/in-place-query?_id=<mydocId>
> >
> > But I never receive a non-nil document in my update handler.
> >
> > What am I doing wrong?
>

Re: How to pass id as a query parameter to an Update Handler

Posted by Jeff Charette <io...@yahoo.com>.
First one is correct.  Check your design doc has the update handler.  Also make sure you are doing a post.

Jeff Charette | Principal 
We Are Charette
web / identity / packaging

m  415.298.2707
w  wearecharette.com
e   jeffrey@wearecharette.com

On Mar 20, 2013, at 7:56 PM, Pulkit Singhal <pu...@gmail.com> wrote:

> How can I pass the document id to an update handler via a browser request?
> I've tried:
> http://127.0.0.1:5984/
> <my_database>/_design/<my_designdoc>/_update/in-place-query/<mydocId>
> http://127.0.0.1:5984/
> <my_database>/_design/<my_designdoc>/_update/in-place-query?id=<mydocId>
> http://127.0.0.1:5984/
> <my_database>/_design/<my_designdoc>/_update/in-place-query?_id=<mydocId>
> 
> But I never receive a non-nil document in my update handler.
> 
> What am I doing wrong?