Documentation menu
API reference

Transaction operations

Every supported operation, generated from the same Rust-owned schema as the server and client.

On this page

Operation catalog

Wrap one or more operations in {requestId, operations} and submit to POST /api/v1/execute. Each item includes its op discriminator. The following fields and nested schemas are generated, not independently maintained.

create_collection

FieldTypeRequired
namestringYes
schemaJSONNo
uniqueArray<Array<string>>No
View complete schema
create_collection
{
  "additionalProperties": false,
  "properties": {
    "name": {
      "type": "string"
    },
    "op": {
      "const": "create_collection",
      "type": "string"
    },
    "schema": {
      "default": null
    },
    "unique": {
      "default": [],
      "items": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "type": "array"
    }
  },
  "required": [
    "op",
    "name"
  ],
  "type": "object"
}

create_index

FieldTypeRequired
collectionstringYes
fieldsArray<string>Yes
namestringYes
sparsebooleanNo
uniquebooleanNo
View complete schema
create_index
{
  "additionalProperties": false,
  "properties": {
    "collection": {
      "type": "string"
    },
    "fields": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "name": {
      "type": "string"
    },
    "op": {
      "const": "create_index",
      "type": "string"
    },
    "sparse": {
      "type": "boolean"
    },
    "unique": {
      "type": "boolean"
    }
  },
  "required": [
    "op",
    "collection",
    "name",
    "fields"
  ],
  "type": "object"
}

create_ttl_index

FieldTypeRequired
collectionstringYes
expireAfterintegerYes
fieldstringYes
namestringYes
View complete schema
create_ttl_index
{
  "additionalProperties": false,
  "properties": {
    "collection": {
      "type": "string"
    },
    "expireAfter": {
      "format": "uint64",
      "minimum": 0,
      "type": "integer"
    },
    "field": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "op": {
      "const": "create_ttl_index",
      "type": "string"
    }
  },
  "required": [
    "op",
    "collection",
    "name",
    "field",
    "expireAfter"
  ],
  "type": "object"
}

drop_index

FieldTypeRequired
collectionstringYes
namestringYes
View complete schema
drop_index
{
  "additionalProperties": false,
  "properties": {
    "collection": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "op": {
      "const": "drop_index",
      "type": "string"
    }
  },
  "required": [
    "op",
    "collection",
    "name"
  ],
  "type": "object"
}

list_records

FieldTypeRequired
afterstring | nullNo
collectionstringYes
limitinteger | nullNo
View complete schema
list_records
{
  "additionalProperties": false,
  "properties": {
    "after": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "collection": {
      "type": "string"
    },
    "limit": {
      "default": null,
      "format": "uint",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "op": {
      "const": "list_records",
      "type": "string"
    }
  },
  "required": [
    "op",
    "collection"
  ],
  "type": "object"
}

get

FieldTypeRequired
collectionstringYes
keystringYes
View complete schema
get
{
  "additionalProperties": false,
  "properties": {
    "collection": {
      "type": "string"
    },
    "key": {
      "type": "string"
    },
    "op": {
      "const": "get",
      "type": "string"
    }
  },
  "required": [
    "op",
    "collection",
    "key"
  ],
  "type": "object"
}

insert

FieldTypeRequired
collectionstringYes
keystring | nullNo
valueobjectYes
View complete schema
insert
{
  "additionalProperties": false,
  "properties": {
    "collection": {
      "type": "string"
    },
    "key": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "op": {
      "const": "insert",
      "type": "string"
    },
    "value": {
      "additionalProperties": true,
      "type": "object"
    }
  },
  "required": [
    "op",
    "collection",
    "value"
  ],
  "type": "object"
}

import_record

FieldTypeRequired
collectionstringYes
recordStoredRecordYes
View complete schema
import_record
{
  "additionalProperties": false,
  "description": "Administrator-only insertion preserving an external opaque revision.\nExisting keys are never replaced. Native revisions use verified restore.",
  "properties": {
    "collection": {
      "type": "string"
    },
    "op": {
      "const": "import_record",
      "type": "string"
    },
    "record": {
      "$ref": "#/$defs/StoredRecord"
    }
  },
  "required": [
    "op",
    "collection",
    "record"
  ],
  "type": "object"
}

replace

FieldTypeRequired
collectionstringYes
keystringYes
revisionstringYes
valueobjectYes
View complete schema
replace
{
  "additionalProperties": false,
  "properties": {
    "collection": {
      "type": "string"
    },
    "key": {
      "type": "string"
    },
    "op": {
      "const": "replace",
      "type": "string"
    },
    "revision": {
      "type": "string"
    },
    "value": {
      "additionalProperties": true,
      "type": "object"
    }
  },
  "required": [
    "op",
    "collection",
    "key",
    "revision",
    "value"
  ],
  "type": "object"
}

delete

FieldTypeRequired
collectionstringYes
keystringYes
revisionstringYes
View complete schema
delete
{
  "additionalProperties": false,
  "properties": {
    "collection": {
      "type": "string"
    },
    "key": {
      "type": "string"
    },
    "op": {
      "const": "delete",
      "type": "string"
    },
    "revision": {
      "type": "string"
    }
  },
  "required": [
    "op",
    "collection",
    "key",
    "revision"
  ],
  "type": "object"
}

begin_upload

FieldTypeRequired
contentTypestringYes
namestringYes
totalSizeintegerYes
View complete schema
begin_upload
{
  "additionalProperties": false,
  "properties": {
    "contentType": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "op": {
      "const": "begin_upload",
      "type": "string"
    },
    "totalSize": {
      "format": "uint64",
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "op",
    "name",
    "totalSize",
    "contentType"
  ],
  "type": "object"
}

complete_upload

FieldTypeRequired
keystring | nullNo
uploadIdstringYes
View complete schema
complete_upload
{
  "additionalProperties": false,
  "properties": {
    "key": {
      "default": null,
      "type": [
        "string",
        "null"
      ]
    },
    "op": {
      "const": "complete_upload",
      "type": "string"
    },
    "uploadId": {
      "type": "string"
    }
  },
  "required": [
    "op",
    "uploadId"
  ],
  "type": "object"
}

query

FieldTypeRequired
bindingsobjectNo
expectedCount

Require this many returned/affected rows or roll back the entire transaction. SELECT counts its result after LIMIT, not all matches.

integer | nullNo
qqlstringYes
View complete schema
query
{
  "additionalProperties": false,
  "properties": {
    "bindings": {
      "additionalProperties": true,
      "default": {},
      "type": "object"
    },
    "expectedCount": {
      "description": "Require this many returned/affected rows or roll back the entire\ntransaction. SELECT counts its result after LIMIT, not all matches.",
      "format": "uint",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "op": {
      "const": "query",
      "type": "string"
    },
    "qql": {
      "type": "string"
    }
  },
  "required": [
    "op",
    "qql"
  ],
  "type": "object"
}