Marcus,

Update handlers can't query the database nor access external
resources. They just update or create a single document based on the
HTTP request (and the current document object, in the case of updating
an existing document).

Moreover, if you want to update a document, you'll need to provide the
ID. So, you can either construct the ID from variables available at
that point in your program, or make a query to find the doc ID before
calling your update handler.

Give this a read:
http://wiki.apache.org/couchdb/Document_Update_Handlers

If you provide more background about your scenario, I can give you
more explicit advice.


Cheers,

Zach


On Thu, Nov 11, 2010 at 8:59 AM, Wordit Ltd <[email protected]> wrote:
> Do update handlers require the doc id, or is it possible to search for
> the doc as with views?
>
> I need to update the document belonging to the logged in user. (I'll
> use a validation function to check that.)
> The only workaround I could think of is using the username as the doc
> id. Then I call the update handler with .../handler/username?param=x
>
> Marcus
>

Reply via email to