DQL Queries
This article provides an overview of how to perform Ditto Query Language (DQL) queries in Ditto using the HTTP data API.
Use the following endpoint to execute your queries: https://<CLOUD_ENDPOINT>/api/v4/store/execute
The DQL HTTP API supports the following DQL commands:
- SELECT
- INSERT
- UPDATE
To retrieve documents from a collection, use a SELECT statement and, if desired, include optional clauses pinpointing criteria to further filter results.
For more information, see Ditto Query Language > SELECT.
The following table provides an overview of the various clauses you can use to set granular controls for filter operations:
The following syntax outlines the basic structure of a SELECT statement:
For instance, performing the following cURL request to SELECT documents from the cars collection:
After invoking a request to INSERT documents, Ditto returns a response object similar to the following example:
To create new documents, use an INSERT statement and, if desired, optional arguments defining the fields to include.
cURL Request
For example, initiating creating doc1 and doc2 as follows:
Sample Response
The following snippet outlines the structure of a typical response for insert or update document operations: