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: `//_design//_update//` + * a POST request agasint the handler function without a document id: `//_design//_update/` - 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//_design//_update/in-place/?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?