You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2012/01/17 01:33:21 UTC

[Couchdb Wiki] Trivial Update of "HTTP_view_API" by GeorgeSerbanut

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 GeorgeSerbanut:
http://wiki.apache.org/couchdb/HTTP_view_API?action=diff&rev1=60&rev2=61

  }}}
  == View Generation Options ==
  There is currently one option that affects the data written into a view. To [[https://issues.apache.org/jira/browse/COUCHDB-346|include documents' local sequence numbers]] in the index, so they will appear in the query results, add the following to the design document:
+ 
  {{{#!highlight javascript
-     options : { 
+     options : {
-         local_seq : true 
+         local_seq : true
      }
  }}}
  (Unlike the querying options below, this isn't a URL parameter because it takes effect when the view index is ''generated'', not when it's ''accessed''.)
@@ -115, +116 @@

  ||'''endkey_docid''' ||''document id'' ||''-'' ||last document id to include in the output (to allow pagination for duplicate endkeys) ||
  ||'''limit''' ||''number of docs'' ||''-'' ||Limit the number of documents in the output ||
  ||'''stale''' ||''ok'' / ''update_after'' ||''-'' ||If '''stale=ok''' is set, CouchDB will not refresh the view even if it is stale, the benefit is a an improved query latency. If '''stale=update_after''' is set, CouchDB will update the view '''after''' the stale result is returned. update_after was added in version 1.1.0. ||
- ||'''descending''' ||''true / false'' ||''false'' ||reverse the output ||
+ ||'''descending''' ||''true / false'' ||''false'' ||change the direction of search ||
  ||'''skip''' ||''number of docs'' ||''0'' ||skip ''n'' number of documents ||
  ||'''group''' ||''true'' ||''false'' ||The group option controls whether the reduce function reduces to a set of distinct keys or to a single result row. ||
  ||'''group_level''' ||''number'' ||''-'' ||''see below'' ||
@@ -138, +139 @@

  
  If you specify ''?limit=0'' you don't get any data, but all meta-data for this View. The number of documents in this View for example.
  
- 
  ''Note: Multiple keys request to a reduce function only supports group=true and NO group_level (identical to group_level=exact). The resulting error is "Multi-key fetchs for reduce view must include `group=true`"''
- 
- 
  
  The ''skip'' option should only be used with small values, as skipping a large range of documents this way is inefficient (it scans the index from the startkey and then skips N elements, but still needs to read all the index values to do that). For efficient paging you'll need to use ''startkey'' and ''limit''. If you expect to have multiple documents emit identical keys, you'll need to use ''startkey_docid'' in addition to ''startkey'' to paginate correctly. The reason is that ''startkey'' alone will no longer be sufficient to uniquely identify a row.
  
@@ -186, +184 @@

  }
  }}}
  === Meaning of the status hash ===
- ||'''Key''' ||||<style="text-align: center;">'''Description''' ||
+ ||'''Key''' ||||<style="text-align:center;">'''Description''' ||
- ||''name'' ||||<style="text-align: center;">Name of the design document without the ''_design'' prefix (string) ||
+ ||''name'' ||||<style="text-align:center;">Name of the design document without the ''_design'' prefix (string) ||
- ||''view_index'' ||||<style="text-align: center;">Contains information on the views (JSON object) ||
+ ||''view_index'' ||||<style="text-align:center;">Contains information on the views (JSON object) ||
  || ||'''Subkeys of''' '''''view_index''''' ||'''Description''' ||
  || ||''signature'' ||The MD5 representation of the views of a design document (string) ||
  || ||''language'' ||Language of the views used (string) ||