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 "HttpViewApi" by PaulDavis
Date Mon, 20 Oct 2008 10:43:23 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 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 ==
  

Mime
View raw message