glynnbird closed pull request #111: FIX README update handler example code 
fixes #110
URL: https://github.com/apache/couchdb-nano/pull/111
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index fe4ac98..5933f92 100644
--- a/README.md
+++ b/README.md
@@ -896,8 +896,10 @@ An example update handler follows:
 ```js
 "updates": {
   "in-place" : "function(doc, req) {
-      var field = req.form.field;
-      var value = req.form.value;
+      var request_body = JSON.parse(req.body);
+  
+      var field = request_body.field;
+      var value = request_body.value;
       var message = 'set ' + field + ' to ' + value;
       doc[field] = value;
       return [doc, message];


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to