Working With CouchDB

Applies to ReadyAPI 3.57, last modified on December 20, 2024

Apache CouchDB is an open-source database. Unlike other databases, it stores data in JSON documents instead of tables. Each of these documents is a separate entity and has its own schema.

The CouchDB database has a REST API which allows you to work with the database's JSON documents. With this API, you can create your own requests right in ReadyAPI to work with JSON documents inside the database and get the necessary data from the CouchDB server.

To learn more about specifics of the CouchDB API, see the CouchDB documentation. You can also check the detailed description of CouchDB responses and possible HTTP status codes.

Creating a Database Record – Example

You can use ReadyAPI to create new CouchDB database records with the CouchDB API.

This example describes how to work with a fresh installation of a CouchDB database. To learn how to install it, see the CouchDB documentation.

  1. Create a new CouchDB database. For this example, name it sample.

    CouchDB: Creating a database
  2. Create a new ReadyAPI project. To do that, select File > New Functional Test.

    ReadyAPI: Creating a new project
  3. Select Endpoint.

    ReadyAPI: Selecting an endpoint as a project's source
  4. Click Next.

  5. Enter the database URI in the following order:

    <CouchDB URI>/<Database name>

  6. Select the POST method for the new request.

    ReadyAPI: Specifying the request method
  7. ReadyAPI will suggest running the test or creating a data-driven test. You do not need these options now, so close the dialog.

  8. Open the REST Request test step.

  9. Make sure to select the application/json Media Type.

  10. Create a request payload. Set the Sample field and the Data value.

    ReadyAPI: Creating a request payload
  11. To send the request, click Send.

    ReadyAPI: Sending the request

ReadyAPI will send a request to CouchDB, and it will create a new document with the data you sent.

Highlight search results