v1

latestOpenAPI 3.0.32026-07-2652928.6 KB

Perform one or more write operations (updates, upserts, or removals) in a single atomic transaction. This endpoint ensures all operations either succeed or fail together, maintaining data consistency.

post/store/write

Headers

X-DITTO-TXN-IDinteger

Optional transaction ID that ensures write consistency. The operation will only proceed if the Big Peer's transaction ID is at least this value, preventing concurrent modification issues.

Request body

Example request

{
  "commands": [
    {
      "method": "upsert",
      "collection": "people",
      "id": 1,
      "value": {
        "name": "Susan",
        "age": 31,
        "favoriteBook": {
          "published": 1925,
          "title": "The Great Gatsby"
        }
      }
    }
  ]
}

Response

The write operations completed successfully. Returns results for each command, including the new transaction ID and counts of affected documents.