DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Building REST API Backend Easily With Ballerina Language
  • Composite Requests in Salesforce Are a Great Idea
  • REST APIs: Simplicity, Flexibility, and Adoption
  • API Testing With Cypress

Trending

  • The Human Side of Logs: What Unstructured Data Is Trying to Tell You
  • 5 Subtle Indicators Your Development Environment Is Under Siege
  • Testing SingleStore's MCP Server
  • The Cypress Edge: Next-Level Testing Strategies for React Developers
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. CouchDB REST API for Document CRUD Operations — Examples With Postman

CouchDB REST API for Document CRUD Operations — Examples With Postman

In this tutorial, we will learn how to perform CRUD operations with the help of HTTP requests firing from Postman.

By 
Mallikarjun M user avatar
Mallikarjun M
·
Updated Jan. 16, 20 · Tutorial
Likes (7)
Comment
Save
Tweet
Share
42.6K Views

Join the DZone community and get the full member experience.

Join For Free

In this tutorial, we will learn how to perform CRUD operations with the help of HTTP requests firing from Postman.

Assumptions

  1. The CouchDB Server is running at http://127.0.0.1:5789/
  2. Database name is tutorialkart.
  3. The database contains the following two documents (viewed in table view).

Documents in CouchDB Database

View Document — GET Request

Request type: GET

URL: http://hostname_or_IP:Port/databasename/document_id/

URL for this Example: http://127.0.0.1:5984/tutorialkart/0001/

CouchDB - GET Document

Update Document — PUT Request

Request type: PUT

URL: http://hostname_or_IP:Port/databasename/document_id/

URL for this Example: http://127.0.0.1:5984/tutorialkart/0001/

Request Body:

Java
xxxxxxxxxx
1
 
1
{
2
    "_rev": "2-74fe79dd659ef45ae32956d3ad4985ab",
3
    "category": "NoSQL Databases"
4
}

_rev has to be sent for the document which you would like to edit, along with the fields that need an update. You will get _rev when you GET the document.

Image title

Delete Document — PUT Request

Request type: DELETE

URL: http://hostname_or_IP:Port/databasename/document_id/?rev=revsion_number

URL for this Example: http://127.0.0.1:5984/tutorialkart/0001/?rev=3-d740acd633d56c9522915fa9fc4579e7

_rev has to be sent for the document which you would like to delete as a parameter in the request.

CouchDB - DELETE Document

Create Document — PUT Request

Request type: PUT

URL: http://hostname_or_IP:Port/databasename/new_document_id/

URL for this Example: http://127.0.0.1:5984/tutorialkart/0003/

Request Body:

Java




x


 
1
{
2
  "tutorial": "Spark Tutorial",
3
  "category": "Big Data",
4
  "topics": 4
5
}


_rev has to be sent for the document which you would like to edit, along with the fields that needs an update. You will get _rev when you GET the document.

Image title

Conclusion

Concluding this article, we have learned how to make CRUD operations for a document in CouchDB Database, with the help of Postman.

Document REST API Web Protocols Requests

Opinions expressed by DZone contributors are their own.

Related

  • Building REST API Backend Easily With Ballerina Language
  • Composite Requests in Salesforce Are a Great Idea
  • REST APIs: Simplicity, Flexibility, and Adoption
  • API Testing With Cypress

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!