POST
/
store
/
execute
{
  "transactionId": 100,
  "queryType": "select",
  "items": [
    {
      "_id": 1,
      "name": "Francis",
      "favoriteBook": {
        "title": "The Great Gatsby",
        "published": 1925
      }
    }
  ],
  "mutatedDocumentIds": [],
  "error": {},
  "warnings": [],
  "totalWarningsCount": 0
}

Authorizations

Authorization
string
header
required

Authentication using either an API key or JWT token in the Authorization header

Headers

X-DITTO-TXN-ID
integer

Optional transaction ID that ensures consistency across operations. When provided, the operation will only execute if the Big Peer's current transaction ID meets or exceeds this value, preventing stale reads and ensuring causal consistency in your application.

Body

application/json
The DQL statement to execute, along with any parameterized arguments. Using parameterized queries with the args field helps prevent injection attacks and improves query performance through statement caching.

Request parameters for executing a DQL statement. DQL is Ditto's powerful query language that supports complex queries and data modifications.

statement
string
required

The DQL statement to execute. See https://docs.ditto.live/dql-guide for comprehensive documentation on DQL syntax and features.

args
any

Named parameters to use in the DQL statement, providing safe value substitution and better query performance

Response

200
application/json
The DQL statement executed successfully. The response includes the results of the query, any mutated document IDs, the transaction ID, and any warnings that occurred during execution. For SELECT queries, results appear in the items array. For mutations, affected IDs appear in mutatedDocumentIds.

Response from executing a DQL statement. Contains query results, affected document IDs, and any warnings or errors that occurred.

items
any[]
required
mutatedDocumentIds
any[]
required
queryType
string
required

Indicates the type of query that was executed

totalWarningsCount
integer
required

Total number of warnings generated during query execution

warnings
object[]
required

Indicates any run-time warnings that might arise during query execution

error
object

An error occurred that prevented the query from executing or completing successfully

transactionId
integer