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.

Answers


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


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

"http://server/_all_dbs"

but it is realy messy.

You can use jq to make this less messy:

ccurl /all_dbs | jq

(The above uses ccurl to make life easier.)


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:PASSWORD@127.0.0.1:5984/_all_dbs

Need Your Help

Apache Spark Broadcast variables are type Broadcast? Not a RDD?

java python scala apache-spark

Just trying to clarify something, some low-hanging fruit, a question generated by watching a user in another question trying to call RDD operations on a broadcast variable? That's wrong, right?

MFC .exe and .dll produce different resuls for same code

c++ delphi visual-studio-2008 dll mfc

I faced following issue with my work: having two projects: MFC .dll and MFC .exe based on same source code (except entry points of course), I observe different results produced by them when process...