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 GeorgeSerbanut
Date Tue, 17 Jan 2012 00:19:12 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 GeorgeSerbanut:
http://wiki.apache.org/couchdb/Formatting_with_Show_and_List?action=diff&rev1=30&rev2=31

  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 ==
-   [[http://guide.couchdb.org/draft/show.html|CouchDB Guide section]]
+  . [[http://guide.couchdb.org/draft/show.html|CouchDB Guide section]]
  
  Show functions are stored in your design document, under the `shows` key. Here's an example
set of show functions:
  
@@ -69, +69 @@

  Since CouchDB 0.11.0 you can use the `send()` function as explained below in show functions
as well.
  
  == Listing Views with CouchDB 0.10 and later ==
-   [[http://guide.couchdb.org/draft/transforming.html|CouchDB Guide section]]
+  . [[http://guide.couchdb.org/draft/transforming.html|CouchDB Guide section]]
  
  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:
  
@@ -77, +77 @@

  {
      "_id": "_design/examples",
      "views" {
-         "posts-by-date": "function(doc){ /*...*/ }",
+         "posts-by-date": {"map": "function(doc){ /*...*/ }"},
-         "posts-by-tag": "function(doc){ /*...*/ }",
+         "posts-by-tag": {"map": "function(doc){ /*...*/ }"},
-         "people-by-name": "function(doc) { /*...*/ }"
+         "people-by-name": {"map": "function(doc) { /*...*/ }"}
      },
      "lists": {
          "index-posts": "function(head, req) { /*...*/ }",
@@ -185, +185 @@

    start({"code": 302, "headers": {"Location": "/"}});
  }
  }}}
- 
  See [[Advanced_Shows_and_Lists_Throwing_Redirects]]
  
  === Specifying Content-Type Response Header ===

Mime
View raw message