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 "Formatting_with_Show_and_List" by yaMatt
Date Wed, 24 Nov 2010 12:40:02 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Formatting_with_Show_and_List" page has been changed by yaMatt.
The comment on this change is: req.docId is always undefined. req.id actually contains the
value..
http://wiki.apache.org/couchdb/Formatting_with_Show_and_List?action=diff&rev1=23&rev2=24

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

    }
  }
  }}}
- If the show function is queried with document id that has no corresponding document in the
database, `doc` is `null` and the submitted document shows up in `req.docId`. This is useful
for creating new documents with a name, like in a wiki.
+ If the show function is queried with document id that has no corresponding document in the
database, `doc` is `null` and the submitted document shows up in `req.id`. This is useful
for creating new documents with a name, like in a wiki.
  
- If the show function is queried without a document id at all, doc is `null` and `req.docId`
is `null`. This is useful for creating new documents where the user specifies the new document
id in a user interface, like in a CMS.
+ If the show function is queried without a document id at all, doc is `null` and `req.id`
is `null`. This is useful for creating new documents where the user specifies the new document
id in a user interface, like in a CMS.
  
  {{{#!highlight javascript
  function(doc, req) {
    if(doc) {
      // regular doc display logic
    } else { // document not found
-     if(req.docId) {
+     if(req.id) {
        // handle unused doc id
      } else {
        // handle unspecified doc id

Mime
View raw message