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 RuneSkouLarsen
Date Wed, 22 Jul 2009 15:54:10 GMT
Dear Wiki user,

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

The following page has been changed by RuneSkouLarsen:
http://wiki.apache.org/couchdb/Formatting_with_Show_and_List

------------------------------------------------------------------------------
  
  Show and list functions are side effect free and idempotent. They can not make additional
HTTP requests against CouchDB. Their purpose is to render JSON documents in other formats.
  
- == Showing Documents with couchdb 0.9 ==
+ == Showing Documents ==
  
  Show functions are stored in your design document, under the `shows` key. Here's an example
set of show functions:
  
@@ -66, +66 @@

  
  The request and response objects are of the same format used by `_external` functions, as
documented in ExternalProcesses.
  
+ == Listing Views with couchdb 0.9 ==
- == Showing Documents with couchdb 0.10 ==
- The show API has changed significantly in 0.10.
- 
- Example `show` function
- {{{
- function(head, req){
-   var row;
-   while(row = getRow()) {
-     send(row.value);
-   }
- }
- }}}
- 
- == Listing Views ==
  
  List functions are stored under the `lists` key of a design document. Here's an example
design doc with list functions, in addition to views:
  
@@ -136, +123 @@

      return "<li>"+JSON.stringify(row)+"</li>";
    } else {
      return "</ul><h4>the tail</h4>"
+   }
+ }
+ }}}
+ 
+ == Listing Views with couchdb 0.10 ==
+ The list API has changed significantly from 0.9 to 0.10.
+ 
+ Example `list` function
+ {{{
+ function(head, req){
+   var row;
+   while(row = getRow()) {
+     send(row.value);
    }
  }
  }}}

Mime
View raw message