vector
batch_delete
Delete multiple vectors by key.
db.vectors.delete_many(collection: 'str', keys: 'Sequence[str]') -> 'BatchResult'wire vector_batch_delete
Deletes multiple vector keys and returns one positional mutation result per input key.
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.vectors.delete_many)
Example
Delete many vectors in one commit.
_ = db.vectors.create_collection("docs", 3, metric="cosine")_ = db.vectors.upsert_many("docs", [{"key": "a", "vector": [1.0, 0.0, 0.0]}, {"key": "b", "vector": [0.0, 1.0, 0.0]}])_ = db.vectors.delete_many("docs", ["a", "b"])db.vectors.count("docs")
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| collection | string | yes | Collection name. |
| 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<VectorMutationItem>
- dataBatchResult7
- 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.vector_collection | never | not_started |
| invalid_argument.engine.vector_key | never | not_started |
| not_found.engine.vector_collection | never | not_applicable |
| invalid_argument.engine.vector_batch | never | not_started |
| invalid_argument.executor.vector_batch_duplicate_key | never | not_started |