POST
/
store
/
count
{
  "count": 100,
  "txnId": 9000
}

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 header that ensures consistency. If specified, the operation will only proceed if the Big Peer's transaction ID is equal to or greater than this value. This prevents reading stale data by ensuring you're operating on a sufficiently up-to-date version of the database.

Body

application/json

Request parameters for counting documents in a collection. Use this to get the total number of documents matching specific criteria.

collection
string
required

The name of the collection to count documents in

query
string
required

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

args
any

Optional parameters to use in the parameterized query, providing safe value substitution

Response

200
application/json
The count operation completed successfully. Returns the total number of matching documents and the transaction ID of the operation.

Response from a count operation, providing both the count and transaction ID for consistency tracking.

count
integer
required

The total number of documents that matched the query criteria

txnId
integer
required

The transaction ID at which this count was performed, useful for consistency checks