couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pulkit Singhal <pulkitsing...@gmail.com>
Subject How to workaround missing id in a request to Update Handler
Date Tue, 19 Mar 2013 19:57:13 GMT
1) I have a 3rd-party-webhook API calling into my update handler and
there's nothing I can do to make it pass the document ID in the URL.
2) That means the CouchDB server cannot provide the update function with
the most recent version of that document.
3) But the request does provide a payload from which I can pull out the
document ID ... but by this time I'm inside the update handler function.
4) So my question is: If CouchDB did not provide a doc, is there still a
way for me to:
a) either, fetch the latest version of the doc myself?
b) or, override the existing document with another document formed with my
request payload ... without running into a revision conflict?

I know that I can probably route the request through a proxy that parses
the payload, sets the document ID onto the request URL and sends it own its
way ... but I'd rather leave that as a last resort.

Thoughts?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message