couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "Formatting_with_Show_and_List" by MarkHammond
Date Sat, 17 Oct 2009 05:01:39 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:

  [As above, we assume the database is named "db" and the design doc "examples".]
+ 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"
+ }}}
+ [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".]
  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:

View raw message