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

This is a legacy endpoint that uses the Legacy Query Language.

To use DQL, the current Ditto query language, consider using the execute endpoint.

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 read consistency. The operation will only proceed if the Big Peer's transaction ID is at least this value, preventing reads of stale data.

Body

application/json
Specify the collection to query, the query conditions, and optional parameters like limit, offset, and sort order. The query can be parameterized using the args field for safe and efficient execution.

Request parameters for querying documents in a collection. Supports filtering, pagination, and sorting to help you retrieve exactly the data you need.

collection
string
required

The name of the collection to query

query
string
required

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

args
any

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

describe
boolean
default:false

When true, includes additional metadata about the query execution

formatAttachment
boolean
default:false

When true, formats any attachment fields for easier consumption

limit
integer
default:1000

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

offset
integer

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

serializedAs
enum<string>
default:latestValues

Controls how the document data is serialized in the response

Available options:
latestValues,
latestValuesAndTypes
sort
object[]

Specifies the order in which to return matching documents

Specifies how to sort query results by a property

Response

200
application/json
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.
documents
object[]
required

Array of documents matching the query criteria

Represents a document in the Ditto store. Documents are schema-free and can contain nested fields of various CRDT types for conflict-free replication.

txnId
integer

The transaction ID at which this query was performed