couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "Introduction to CouchDB views" by mdornseif
Date Sat, 27 Dec 2008 21:19:33 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 mdornseif:

The comment on the change is:
Added 'Access Strategy' subsection

  Note that all views in a single design document get updated when one of the views in that
design document gets queried. 
  Note on !JavaScript API change: Prior to Tue, 20 May 2008 (Subversion revision r658405)
the function to emit a row to the map index, was named "map". It has now been changed to "emit".
  == Basics ==
@@ -123, +124 @@

  Often, reduce functions can be written to handle rereduce calls without any extra code,
like the summation function above. In that case, the ''rereduce'' argument can be ignored
and in JavaScript, it can be omitted from the function definition entirely.
+ === Access Strategy ===
+ For queries which are not meant to actually condense the amount of information you often
can life without a reduce function. A common strategy is to get the data you are interested
to select by in into the ''key'' part and then use ''startkey'' and ''endkey'' on the result.
  == Lookup Views ==
  The second parameter of the ''emit()'' function can be ''NULL''. CouchDB then only stores
the key in the view. If you use the document's ID here, you can use the view as a compact
lookup mechanism and fetch the document's details, if needed, in subsequent requests.
@@ -135, +140 @@

  == Views in Practice ==
- See HttpViewApi to learn how to work with views.
+ See HttpViewApi to learn how to work with views. ["View_Snippets"] contain a few examples.

View raw message