couchdbcouchdb-nano

get list of all view names in couchdb


Is it possible to get a list of all the views of a database in couchdb using [dscape/nano][1]? The closest I can get with just curl request is this:

http://URL/DBNAME/_all_docs?key=_design/views&include_docs=true.

The above returns all the views including the javascript functions. But I would like to extract only the view names.


Solution

  • Unfortunately the only possible way of doing this is by extracting view names from the result of the query you've included in your question. Futon is doing it this way when populating drop-down list of views, so I think it is safe to assume this is the only solution.

    You may also want to change your query to the following to include all design documents, instead of just the one named views:

    GET /dbname/_all_docs?startkey="_design/"&endkey="_design0"&include_docs=true