couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "Document_Update_Handlers" by TimSmith
Date Mon, 11 Oct 2010 17:04:39 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Document_Update_Handlers" page has been changed by TimSmith.
The comment on this change is: Describe POST usage as well as PUT.


  == Usage ==
- To invoke a handler, one must "PUT" the document against the handler function itself (POST
does not seem to be supported). Using the canonical document URL won't invoke any handlers.
+ To invoke a handler, use one of:
+  * a PUT request against the handler function with a document id: `/<database>/_design/<design>/_update/<function>/<docid>`
+  * a POST request agasint the handler function without a document id: `/<database>/_design/<design>/_update/<function>`
- For example, to invoke the "in-place" handler defined above, the URL to use is:
+ For example, to invoke the `in-place` handler defined above, PUT to:
@@ -86, +88 @@

  This means that unlike document validators, the user's intent must be clear by calling this
individual handler explicitly. In this sense, you should think about an ''_update'' handler
as complementary to ''_show'' functions, not to ''validate_doc_update'' functions.
+ For more information, look at ''update_documents.js'' in the test suite.
  == TBD ==
-  * Is POST supported, or only PUT?
-    * Maybe we should support PATCH?
+  * Maybe we should support PATCH?
   * Must fields be sent as URL query parameters, or can they be sent in the request representation?

View raw message