v1

latestOpenAPI 3.0.32026-07-2652928.6 KB

Execute a DQL query

Execute a Ditto Query Language (DQL) statement against your data store. DQL is a powerful query language that supports complex queries, updates, and data manipulation. This endpoint serves as the primary interface for running DQL operations. See the comprehensive DQL guide for detailed syntax and examples.

post/store/execute

Headers

X-DITTO-TXN-IDinteger

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.

Request body

{"stackTrail":"components:schemas:AnyValue","oasType":"schema","type":"unknown"}
statementstring required

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

Example request

{
  "statement": "SELECT * FROM people WHERE favoriteBook.title = :title",
  "args": {
    "title": "The Great Gatsby"
  }
}

Response

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.

queryTypestring required

Indicates the type of query that was executed

totalWarningsCountinteger required

Total number of warnings generated during query execution

transactionIdinteger