0% found this document useful (0 votes)
23 views3 pages

CouchDB - Deleting A Database

Uploaded by

vallalanikhil7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views3 pages

CouchDB - Deleting A Database

Uploaded by

vallalanikhil7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Page 1 of 3

CouchDB - Deleting a Database


Deleting a Database using cURL Utility
You can delete a database in CouchDB by sending a request to the server using DELETE
method through cURL utility. Following is the syntax to create a database −

$ curl -X DELETE http://127.0.0.1:5984/database name

Using −X we can specify a custom request method of HTTP we are using, while
communicating with the HTTP server. In this case, we are using the DELETE method. Send
the url to the server by specifying the database to be deleted in it.

Example
Assume there is a database named my_database2 in CouchDB. Using the above given
syntax if you want to delete it, you can do it as follows −

$ curl -X DELETE http://127.0.0.1:5984/my_database2


{
"ok" : true
}

As a response, the server will return you a JSON document with content “ok” − true
indicating the operation was successful.

Verification
Verify whether the database is deleted by listing out all the databases as shown below. Here
you can observe the name of the deleted database, "my_database" is not there in the list.

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

[ "_replicator " , " _users " ]

Deleting a Database using Futon


To delete a database, open the http://127.0.0.1:5984/_utils/ url where you will get an
Overview/index page of CouchDB as shown below.

https://w w w .tutorialspoint.com/couchdb/couchdb_deleting_a_database.htm 1/3


Page 2 of 3

Here you can see three user created databases. Let us delete the database named
tutorials_point2. To delete a database, select one from the list of databases, and click on it,
which will lead to the overview page of the selected database where you can see the
various operations on databases. The following screenshot shows the same −

Among them you can find Delete Database option. By clicking on it you will get a popup
window, asking whether you are sure! Click on delete, to delete the selected database.

https://w w w .tutorialspoint.com/couchdb/couchdb_deleting_a_database.htm 2/3


Page 3 of 3

https://w w w .tutorialspoint.com/couchdb/couchdb_deleting_a_database.htm 3/3

You might also like