couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Prater <>
Subject Re: how do views work with shows
Date Tue, 10 Aug 2010 18:19:20 GMT
I'd be interested in know how exactly you get cacheable lists and  
shows in a CouchApp.

I understand instantly why they'd be cacheable on the client side, and  
how you could do it with Squid,
but it seems like lists and shows wouldn't be cacheable to multiple  
clients in a pure CouchApp.

Am I missing something?


On Aug 10, 2010, at 12:58 PM, Dave Cottlehuber wrote:

> On 11 August 2010 05:43,  <> wrote:
>> I'm having trouble understanding what you do with a view.
>> There are shows and views but there is seemingly no link
>> between them.
>> A view will give you back a json information.
>> A show will render a web page with body and header info
>> but how do you get a view to work with a show
> You don't as far as I know. quotes from TDG.
> just remember: lists are to views, as shows are to docs. same purpose,
> different scope.
> "Just as show functions convert documents to arbitrary output formats,
> CouchDB list functions  allow you to render the output of view queries
> in any format. The powerful iterator API allows for flexibility to
> filter and aggregate rows on the fly, as well as outputting raw
> transformations for an easy way to make Atom feeds, HTML lists, CSV
> files, config files, or even just modified JSON."
> lists are good for summary data across multiple docs:
> doc (single JSON doc) -> view (map-reduced values from many docs, in
> JSON)  -> list (transformed JSON in any format you like)
> "Because a show function will always return the same result given the
> same input, and can’t change anything about the environment in which
> it runs, it’s output can be cached and intelligently reused."
> shows are designed to be cacheable & side effect free - so they can
> operate only on a single doc
> doc (single JSON doc) -> show (transformed JSON in any format you  
> like)
> This is covered later in the book in more detail.
> I hope I got that right.
> BTW re your previous email, are you doing this in Futon, from a
> command line with curl, how are you uploading the JSON? Give us more
> info.
> A+
> Dave

View raw message