Create Database
In CouchDB, database is the outermost structure where documents are stored. CouchDB provides cURL utility to create databases. You can also use Futon the web interface of CouchDB.
Creating a database using Fauxton
Open the following link in the web browser:
http://127.0.0.1:5984/_utils/.
You will get a page like this:
Click on the “Create Database” tab in the red circle to create a database named “employees”.
It will show a message that database is created successfully. You can check the created database in the database tab.
CouchDB Create Database using cURL Utility
Use the following syntax to create a database in CouchDB by sending an HTTP request to the server using PUT method through cURL utility.
Syntax:
Example:
Create a database named “tutoraspire”. As the response the server will return you a JSON document with content “ok” : true. It specifies that the operation is successful.
Verification
You can verify that if the database is created by listing out all the databases using the following command:
Check Database Information
You can get the information about database using the GET request along with the database name.
Syntax:
Example:
See the below example to get the information of your database name “tutoraspire”.
Output: