couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zachary Zolton <>
Subject Re: Update handler doc ids
Date Thu, 11 Nov 2010 19:45:32 GMT

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:

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



On Thu, Nov 11, 2010 at 8:59 AM, Wordit Ltd <> 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

View raw message