couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael W <>
Subject Understanding views
Date Fri, 26 Feb 2010 15:11:51 GMT
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!


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message