v1

latestOpenAPI 3.0.32026-07-2652928.6 KB

Query documents in a collection using a flexible query language. This endpoint supports pagination, sorting, and complex queries to help you efficiently retrieve exactly the data you need.

post/store/find

Headers

X-DITTO-TXN-IDinteger

Optional transaction ID that ensures read consistency. The operation will only proceed if the Big Peer's transaction ID is at least this value, preventing reads of stale data.

Request body

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

The name of the collection to query

describeboolean

When true, includes additional metadata about the query execution

formatAttachmentboolean

When true, formats any attachment fields for easier consumption

limitinteger

Maximum number of documents to return. Use with offset for pagination.

offsetinteger

Number of documents to skip before starting to return results. Use with limit for pagination.

querystring required

The query expression that filters which documents to return. Use parameterized values with :param syntax for better security and performance.

serializedAs'latestValues' | 'latestValuesAndTypes'

Controls how document values are serialized in responses

Example request

{
  "collection": "people",
  "query": "favoriteBook.title == 'The Great Gatsby'"
}

Response

The query executed successfully. Returns an array of matching documents and the transaction ID of the read operation. If no documents match, the documents array will be empty.

txnIdinteger

The transaction ID at which this query was performed

Example response

{
  "documents": {
    "id": 1,
    "contents": {
      "name": "Francis",
      "favoriteBook": {
        "title": "The Great Gatsby",
        "published": 1925
      }
    }
  },
  "txnId": 9000
}