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 2008/10/20 12:43:23 UTC

[Couchdb Wiki] Update of "HttpViewApi" by PaulDavis

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 PaulDavis:
http://wiki.apache.org/couchdb/HttpViewApi

------------------------------------------------------------------------------
  
  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.
  
- The ''include_docs'' option will return the associated document for map functions that emit a key, but a null value. 
+ The ''include_docs'' option will include the associated document. Although, the user should keep in mind that there is a race condition when using this option. It is possible that between reading the view data and fetching the corresponding document that the document has changed. If you want to alleviate such concerns you should emit an object with a _rev attribute as in ''emit(key, {"_rev": doc._rev})''. This alleviates the race condition but leaves the possiblity that the returned document has been deleted (in which case, it includes the ''"_deleted": true'' attribute).
+ 
  
  == Debugging Views ==