CouchDB Create Document
In CouchDB, data of the database is stored in the form of documents instead of tables.
Create a document in CouchDB database using Fauxton
To create a document in CouchDB database open the Fauxton url:
Choose the specific database and put your cursor on all documents tab. Click on new Doc as shown in the below image:
You will a page like:
Fill the entries which you want in your documents:
After all entries, click on the save changes tab. Now the document is created.
CouchDB Create Document using cURL Utility
To create a document in CouchDB, send an HTTP request to the server using PUT method through cURL utility.
Following is the syntax to create a document.
Note: -X is used to specify a custom request method of HTTP that we use to communicate with the HTTP server. In this case, we are using PUT method. When we use the PUT method, the content of the url specifies the object name we are creating using the HTTP request.
Let's create a document with id "001" with database name javatpoint.
The response of CouchDB for this command contains 3 fields:
You can verify that your document is created by using the following command: