Create Document in CouchDB

Create Document

Instead of tables, data in CouchDB are stored in the form of documents. We can create a document in CouchDB either using Fauxton or cURL Utility.


Using Fauxton:

  • Open the Fauxton URL:
  • Choose the specific database.
  • Put your cursor on all documents tab.
  • Click on NEW DOC.
  • Fill the entries to be added to the document.
  • Click on the save changes tab.
  • The document is thus successfully created.


Using cURL Utility:


curl -X PUT"id" -d ' { document} '



  • database name: It is used to specify the name of the database in which the document needs to be created.
  • Id: It is used to specify the document id.
  • -d: It is used to send the data/document through an HTTP request.
  • document: It is used to specify the data of the document.


curl -H 'Content-Type: application/json' \

-X PUT"100" -d'{"Name":"Tom", "Salary":"30000" , "Designation" : "Engineer" }'



The response will contain 3 fields:

  • “ok”: It is used to specify that the operation is successful.
  • “id”: It is used to store the id of the document.
  • “rev”: It is used to specify the revision id. A _rev value is generated by CouchDB, every time when a document is revised (updated or modified).



Verify the document created using the below command:

curl -X GET
Please follow and like us:
Content Protection by