CouchDB Get Database List

To get the list of all Databases present in a CouchDB, you can make HTTP GET request through REST API or go to Databases tab in Web Interface of CouchDB.

CouchDB Get Database List using REST API

Send a HTTP GET request with the following URL.

http://hostname/_all_dbs/

We have our CouchDB running in our localhost. Hence, we shall use 127.0.0.1:5984 as hostname.

The resulting request URL that we have to use for PUT request will become,

http://127.0.0.1:5984/_all_dbs/

We will use Postman, to trigger a GET request with the URL to get list of databases in CouchDB. You can use any other CLI or GUI tool of your choice.

The result is a JSON array with database names as elements.

Create Document via CouchDB Web Interface

You can also get database list in CouchDB using Web Interface.

Open URL http://hostname/_utils/ in your browser. In this example, the URL will be http://127.0.0.1:5984/_utils/.

Click on Databases tab present in the left panel. You will get the list of all databases.

Summary

In this CouchDB Tutorial, we learned to get the list of databases in CouchDB via HTTP REST API and CouchDB Web Interface.