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 gert
Date Tue, 20 Sep 2011 02:24:43 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 gert:
http://wiki.apache.org/couchdb/Document_Update_Handlers?action=diff&rev1=19&rev2=20

Comment:
escape "

          if (req.id) {
            return [{
              _id : req.id
-           }, "New World"]
+           }, 'New World']
          }
-         return [null, "Empty World"];
+         return [null, 'Empty World'];
        }
-       doc.world = "hello";
+       doc.world = 'hello';
        doc.edited_by = req.userCtx;
-       return [doc, "hello doc"];
+       return [doc, 'hello doc'];
      }",
  
      "in-place" : "function(doc, req) {
        var field = req.form.field;
        var value = req.form.value;
-       var message = "set "+field+" to "+value;
+       var message = 'set '+field+' to '+value;
        doc[field] = value;
        return [doc, message];
      }",
@@ -46, +46 @@

      "bump-counter" : "function(doc, req) {
        if (!doc.counter) doc.counter = 0;
        doc.counter += 1;
-       var message = "<h1>bumped it!</h1>";
+       var message = '<h1>bumped it!</h1>';
        return [doc, message];
      }",
  
@@ -60, +60 @@

        var posted_xml = new XML(req.body);
        doc.via_xml = posted_xml.foo.toString();
        var resp =  {
-         "headers" : {
+         'headers' : {
-           "Content-Type" : "application/xml"
+           'Content-Type' : 'application/xml'
          },
-         "body" : xml
+         'body' : xml
        };
  
         return [doc, resp];

Mime
View raw message