couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils Breunese <>
Subject RE: Understanding views
Date Fri, 26 Feb 2010 20:28:56 GMT
1) A view has a name which needs to be unique in a design document. Other than that there is
no problem storing multiple views in a single design document. I recommend managing you design
documents using CouchApp (also makes it easy to manage your design documents in a version
control system):

2) See the documentation for the HTTP View API for what parameters you can pass to views: You might also want to check out list and show
functions, which add extra flexibility on top of views:


Van: Michael W []
Verzonden: vrijdag 26 februari 2010 16:11
Onderwerp: Understanding views

Hi everybody,

I just started to get familiar with couchDB. One of the most important
resource of my research is the draft of O'Reily's book on couchDB. I belive
I've got a pretty good overview on how couchDB works but there still some
questions regarding views which I hope you can help me to answer.

1) According to the documentation (if I understand correctly) views can be
stored only in design documents and running ad-hoc views is slower than
running pre-defined views (from the ddoc). How can I create multiple views
in one ddoc?
A real-life app wil probably need dozens views and I guess it's not the
recommended way to store each of them in a single ddoc, is it?

2) How can I pass additional parameters to a view? Consider an application
where the user needs to log in and the user id is stored somewhere in the
session object. Now I want to query couchDB to get all documents of a
specific type which the current user has created. How could I pass that user
id to the view function?

Thank you very much in advance for answering my questions.
Have a nice weekend!


De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend bedoeld voor gebruik
door de geadresseerde en kan vertrouwelijke informatie bevatten. Openbaarmaking, vermenigvuldiging,
verspreiding en/of verstrekking van deze informatie aan derden is voorbehouden aan geadresseerde.
De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden
e-mail, noch voor tijdige ontvangst daarvan.

View raw message