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] Trivial Update of "Formatting_with_Show_and_List" by MarkHammond
Date Sat, 17 Oct 2009 05:44:13 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 MarkHammond:
http://wiki.apache.org/couchdb/Formatting_with_Show_and_List?action=diff&rev1=17&rev2=18

  Couchdb 0.10 supports an alternate form of URL which allows you to use a list function and
a view from different design documents.  This is particularly useful when you want to use
a different language for the list and for the view.  These URLs are very similar to the above
examples, but instead of the tail portion being the name of the view, the tail portion can
consist of two parts - a design doc name and the name of the view in that second document.
 For example:
  
  {{{
- GET /db/_design/examples/_list/index-posts/examples2/posts-by-tag?key="howto"
+ GET /db/_design/examples/_list/index-posts/other_ddoc/posts-by-tag?key="howto"
  }}}
- [As above, we assume the database is named "db" and the design doc with the list is named
"examples", while the design doc with the view is "examples2".]
+ [As above, we assume the database is named "db" and the design doc with the list is named
"examples", while the design doc with the view is "other_ddoc".]
  
  A list function has a more interesting signature, as it is passed the head of the view on
first invocation, then each row in turn, then called one more time for the tail of the view.
The function should check the `head` and `row` parameters to identify which state it's being
called in; the sequence of calls to `listfn`, for a view with three rows, would look like:
  

Mime
View raw message