CouchDB - Creating A Database
CouchDB - Creating A Database
Using −X we can specify HTTP custom request method to be used. In this case, we are
using PUT method. When we use the PUT operation/method, the content of the url specifies
the object name we are creating using HTTP request. Here we have to send the name of the
database using put request in the url to create a database.
Example
Using the above given syntax if you want to create a database with name my_database,
you can create it as follows
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 created, by listing out all the databases as shown below. Here
you can observe the name of a newly created database, " my_database " in the list.
In this page, you can see the list of databases in CouchDB, an option button Create
Database on the left hand side.
Now click on the create database link. You can see a popup window Create New
Databases asking for the database name for the new database. Choose any name
following the mentioned criteria. Here we are creating another database with name
tutorials_point. Click on the create button as shown in the following screenshot.