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 "Introduction to CouchDB views" by JedediahSmith
Date Mon, 01 Dec 2008 11:11:13 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 JedediahSmith:
http://wiki.apache.org/couchdb/Introduction_to_CouchDB_views

The comment on the change is:
add reduce examples

------------------------------------------------------------------------------
  1. When ''rereduce'' is ''false'':
   * ''keys'' will be an array whose elements are arrays of the form ''[key,id]'', where ''key''
is a key emitted by the map function and ''id'' is that of the document from which the key
was generated. 
   * ''values'' will be an array of the values emitted for the respective elements in ''keys''
+  * i.e. {{{reduce([ [key1,id1], [key2,id2], [key3,id3] ], [value1,value2,value3], false)}}}
+ 
  2. When ''rereduce'' is ''true'':
   * ''keys'' will be ''null''
   * ''values'' will be an array of values returned by previous calls to the reduce function
+  * i.e. {{{reduce(null, [intermediate1,intermediate2,intermediate3], true)}}}
  
  Reduce functions should return a single value, suitable for both the ''value'' field of
the final view and as a member of the ''values'' array passed to the reduce function.
  

Mime
View raw message