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 "HTTP_view_API" by JensAlfke
Date Wed, 20 Jul 2011 22:44:49 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "HTTP_view_API" page has been changed by JensAlfke:
http://wiki.apache.org/couchdb/HTTP_view_API?action=diff&rev1=56&rev2=57

Comment:
Clarified interaction of 'group' and 'group_level'.

  
  View rows are sorted by the key; specifying ''descending=true'' will reverse their order.
Note that the ''descending'' option is applied before any key filtering, so you may need to
swap the values of the ''startkey'' and ''endkey'' options to get the expected results. The
sorting itself is described in ViewCollation.
  
- The ''group'' option controls whether the reduce function reduces to a set of distinct keys
or to a single result row.
+ The ''group'' and ''group_level'' options control whether the reduce function reduces to
a set of distinct keys or to a single result row. ''group_level'' lets you specify how many
items of the key array are used in grouping; ''group=true'' is effectively the same as ''group_level=999''
(for an arbitrarily high value of 999.) Don't specify both ''group'' and ''group_level'';
the second one given will override the first.
  
  If a view contains both a map and reduce function, querying that view will by default return
the result of the reduce function. The result of the map function only may be retrieved by
passing ''reduce=false'' as a query parameter.
  
@@ -148, +148 @@

  
  In a reduced view result, you need to use `startkey` and `endkey` to match rows instead
of the `key` parameter.
  
- Note: If you use `group_level`, `total_rows` and `offset` will be omitted from the results
(this is done to avoid scanning the entire tree.
+ Note: If you use `group` or `group_level`, `total_rows` and `offset` will be omitted from
the results (for performance reasons, to avoid scanning the entire tree.)
  
  == Getting Information about Design Documents (and their Views) ==
  You can query the design document (''_design/test'' in this case) by GET for some information
on the view:

Mime
View raw message