couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "Views" by JanLehnardt
Date Mon, 13 Oct 2008 12:11:31 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 JanLehnardt:

The comment on the change is:
Add note about temporary views being unsuitable for production.

  '''Permanent views''' are stored inside special documents called design documents, and can
be accessed via an HTTP ''GET'' request to the URI ''/{dbname}/{docid}/{viewname}'', where
''{docid}'' has the prefix ''_view/'' so that CouchDB recognizes the document as a design
  '''Temporary views''' are not stored in the database, but rather executed on demand. To
execute a temporary view, you make an HTTP ''POST'' request to the URI ''/{dbname}/_temp_view'',
where the body of the request contains the code of the view function and the ''Content-Type''
header is set to ''application/json''.
+ '''NOTE''': Temporary views are only good during development. Final code should not rely
on them as they are very expensive to compute each time they get called and they get increasingly
slower the more data you have in a database. If you think you can't solve something in a permanent
view that you can solve in an ad-hoc view, you might want to reconsider. (TODO: add typical
examples and solutions).
  For both kinds of views, the view is defined by a !JavaScript function that maps view keys
to values (although it is possible to use other languages than !JavaScript by plugging in
third-party view servers).

View raw message