On Sat, Jan 10, 2009 at 11:20 AM, Thomas Williams <[email protected]> wrote: > Hi chaps,I've spent a couple of days playing around with version 0.80 and I > think I might be missing something. Is it possible to configure views at > query time or do they have to always be effectively 'static'. I mean can I > write a view something like this: > > function(doc, user_id) { > if(doc.user_id=user_id) > emit(doc) > } > > Then pass user_id as a parameter to each query. If not, does anyone know how > I can go about retrieving data based on a unique key in an efficient manner? >
Views must be pure functions from the doc alone (no other data). The way to build you query is described at http://wiki.apache.org/couchdb/View_Snippets -- Chris Anderson http://jchris.mfdz.com
