Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list all database in CouchDb view,validation functions

I need a get a list of all databases in a Couchdb server inside a view/validation function.

Is there CouchDb predefiend function that i can use it inside function (like emit)?

I know i can do http request to get this , something like :

"http://server/_all_dbs"

but it is realy messy.

Thanks oren.

like image 620
CountOren Avatar asked Jun 14 '12 20:06

CountOren


2 Answers

You have 2 way to list all databases in the CouchDB server

Without Password

curl -X GET http://127.0.0.1:5984/_all_dbs

With Password

curl -X GET http://USER:[email protected]:5984/_all_dbs
like image 181
FErArg Avatar answered Sep 28 '22 00:09

FErArg


No, within a view all you have visibility of is the document that you're processing.

like image 39
smathy Avatar answered Sep 28 '22 01:09

smathy