From 258df4e55296c48699cb75104d7840bbef9f2529 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Sun, 7 Dec 2014 19:06:21 +0200 Subject: [PATCH] Add documentation about update handlers --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 19c8d4a..2b87ad6 100644 --- a/README.md +++ b/README.md @@ -357,9 +357,18 @@ To remove a document, you call the `remove()` method, passing the latest documen }); ``` - If `remove` is called without a revision, and the document was recently fetched from the database, it will attempt to use the cached document's revision, providing caching is enabled. +### update handlers ### + +Update handlers can be used by calling the `update()` method, specifying the update handler name, and optionally the document id, the query object and the document body object. Only the update handler name is a required function parameter. Note that CouchDB is able to parse query options only if the URI-encoded length is less than 8197 characters. Use the body parameter for larger objects. + +``` js + db.update('my_designdoc/update_handler_name', 'luke', undefined, { my_param: false }, function (err, res) { + // Handle the response, specified by the update handler + }); +``` + Connecting with authentication and SSL --------------------------------------