couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
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.
http://wiki.apache.org/couchdb/Document_Update_Handlers?action=diff&rev1=11&rev2=12

--------------------------------------------------

  
  == 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:
  
  {{{
  http://127.0.0.1:5984/<my_database>/_design/<my_designdoc>/_update/in-place/<mydocId>?field=title&value=test
@@ -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?
  

Mime
View raw message