Home » CouchDB Create Database

CouchDB Create Database

by Online Tutorials Library

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:

Create Database 1

Click on the “Create Database” tab in the red circle to create a database named “employees”.

Create Database 2

It will show a message that database is created successfully. You can check the created database in the database tab.

Create Database 3


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.

CouchDB Create database 1

Verification

You can verify that if the database is created by listing out all the databases using the following command:

CouchDB Create database 2


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:

CouchDB Create database 3

You may also like