kv
batch_delete
Delete multiple KV keys in one itemwise batch.
db.kv.delete_many(keys: 'Sequence[str | bytes]') -> 'BatchResult'wire kv_batch_delete
Deletes multiple KV keys and returns one positional mutation result per key. Missing keys are represented as no-op item results.
Itemwise batches return one positional item result per input item. The outer batch status summarizes whether all, some, or none of the items succeeded.
To see the complete help for this command, run:
help(db.kv.delete_many)
Example
Delete many keys in one commit.
_ = db.kv.put_many([{"key": "a", "value": "1"}, {"key": "b", "value": "2"}])_ = db.kv.delete_many(["a", "b"])db.kv.exists_many(["a", "b"])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| keys | array | yes | Keys to delete. |
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| space | string or null | no | Target product space. Defaults to `"default"`. |
Returns
BatchResult<KvMutationItem>
- dataBatchResult
- typestring
Errors
Recover by code. Retry policy and commit outcome come from the shipped error registry.
| Code | Retry | Commit outcome |
|---|---|---|
| failed_precondition.engine.runtime_closed | never | not_started |
| not_found.engine.branch | never | not_applicable |
| invalid_argument.engine.product_space | never | not_started |
| invalid_argument.engine.kv_key | never | not_started |
| invalid_argument.engine.kv_batch | never | not_started |
| invalid_argument.engine.kv_batch_duplicate_key | never | not_started |
| invalid_argument.executor.kv_batch_duplicate_key | never | not_started |