You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Nils Breunese <n....@vpro.nl> on 2009/06/05 11:49:22 UTC

Named view required for list?

Hello all,

I'd like to write a list function to render a database as a CSV file. 
According to the wiki [0] the URL looks like this:

   /<database>/_design/<designdoc>/_list/<list>/<view>

So, a named view is required to run a list function? I'd like to dump 
the complete database to CSV. Of course I could write a simple view 
function that emits all documents, but it would be nice if I could just 
run the list function on the database without using a view.

Is this a technical limitation or design decision? Any ideas on this?

Nils Breunese.

[0] http://wiki.apache.org/couchdb/Formatting_with_Show_and_List

Re: Named view required for list?

Posted by Chris Anderson <jc...@apache.org>.
On Fri, Jun 5, 2009 at 3:40 AM, Jan Lehnardt <ja...@apache.org> wrote:
>
> On 5 Jun 2009, at 11:49, Nils Breunese wrote:
>
>> Hello all,
>>
>> I'd like to write a list function to render a database as a CSV file.
>> According to the wiki [0] the URL looks like this:
>>
>>  /<database>/_design/<designdoc>/_list/<list>/<view>
>>
>> So, a named view is required to run a list function? I'd like to dump the
>> complete database to CSV. Of course I could write a simple view function
>> that emits all documents, but it would be nice if I could just run the list
>> function on the database without using a view.
>>
>> Is this a technical limitation or design decision? Any ideas on this?
>
> We could special-case the _all_docs view.

I think we should offer lists on the _all_docs view. It will be a
smallish Erlang patch, if anyone feels like it.

I doubt I'll have time to implement, but this is a feature we'll want
and should be simple to write. If you take it up, please discuss your
progress on the @dev list

>, but then, doing it manually is
> so simple that I'd rather not add that to core CouchDB (…just yet, if
> there's
> more demand for this feature, I'm happy to reconsider :)
>
> Cheers
> Jan
> --
>
>



-- 
Chris Anderson
http://jchrisa.net
http://couch.io

Re: Named view required for list?

Posted by Jan Lehnardt <ja...@apache.org>.
On 5 Jun 2009, at 11:49, Nils Breunese wrote:

> Hello all,
>
> I'd like to write a list function to render a database as a CSV  
> file. According to the wiki [0] the URL looks like this:
>
>  /<database>/_design/<designdoc>/_list/<list>/<view>
>
> So, a named view is required to run a list function? I'd like to  
> dump the complete database to CSV. Of course I could write a simple  
> view function that emits all documents, but it would be nice if I  
> could just run the list function on the database without using a view.
>
> Is this a technical limitation or design decision? Any ideas on this?

We could special-case the _all_docs view, but then, doing it manually is
so simple that I'd rather not add that to core CouchDB (…just yet, if  
there's
more demand for this feature, I'm happy to reconsider :)

Cheers
Jan
--