RPC Endpoint
Use the following endpoint to execute your queries:https://<CLOUD_ENDPOINT>/api/v4/store/execute
DQL Support
The DQL HTTP API supports the following DQL commands:SELECT
INSERT
UPDATE
EVICT
is not currently available for Ditto Server, although it’s in development. To learn more about removing data from your Ditto Server instance, see Writing: HTTP (Legacy) .SELECT
To retrieve documents from a collection, use aSELECT
statement and, if desired, include optional clauses pinpointing criteria to further filter results.
For more information, see Ditto Query Language > SELECT.
Optional Clauses for Filtering
The following table provides an overview of the various clauses you can use to set granular controls for filter operations:Clause | Description |
---|---|
FROM | The required clause specifying the collection containing the documents for retrieval. (See FROM) |
WHERE | Applies filtering conditions to restrict the documents included in the result set. (See WHERE) |
ORDER BY | Specifies the sorting order of the result set based on one or more expressions. (See ORDER BY) |
LIMIT | Restricts the number of documents included in the result set. (See LIMIT) |
OFFSET | Skips a specific number of documents before returning the result set. (See OFFSET) |
Basic SELECT Operation
The following syntax outlines the basic structure of aSELECT
statement:
DQL
cURL** Request**
For instance, performing the following cURL request toSELECT
documents from the cars
collection (make sure to replace the {canonical-root-url}
parameter with your canonical root URL. See see here for how to get your canonocal root URL):
Curl
Response Object
After invoking a request toINSERT
documents, Ditto returns a response object similar to the following example:
JSON
INSERT with Arguments
To create new documents, use anINSERT
statement and, if desired, optional arguments defining the fields to include.
DQL
doc1
and doc2
as follows (make sure to replace the {canonical-root-url}
parameter with your canonical root URL. See see here for how to get your canonocal root URL):
CURl
JSON
UPDATE
To modify the content of existing documents in a collection, use the UPDATE operation.DQL
Response Object Definition
The following snippet outlines the structure of a typical response forinsert
or update
document operations:
JSON