You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2009/07/22 17:45:46 UTC
[Couchdb Wiki] Update of "Formatting with Show and List" by RuneSkouLarsen
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
The comment on the change is:
Started show-api chapter for 0.10
------------------------------------------------------------------------------
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 ==
+ == Showing Documents (in 0.9) ==
Show functions are stored in your design document, under the `shows` key. Here's an example set of show functions:
@@ -65, +65 @@
The request and response objects are of the same format used by `_external` functions, as documented in ExternalProcesses.
+
+ == Showing Documents (in 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 ==