vector
exists
Check whether one vector key exists.
strata vector existsdb.vectors.exists(collection: 'str', key: 'str') -> 'bool'wire vector_exists
Returns a boolean status for one vector key without loading the embedding.
Status commands return a scalar or compact status payload and do not mutate database state.
To see the complete help for this command, run:
strata vector exists --helphelp(db.vectors.exists)
Example
Check whether a key exists in a collection.
strata vector collection create docs 3 --metric cosinestrata vector upsert docs a [1.0,0.0,0.0]strata vector exists docs astrata vector exists docs absent
_ = db.vectors.create_collection("docs", 3, metric="cosine")_ = db.vectors.upsert("docs", "a", [1.0, 0.0, 0.0])db.vectors.exists("docs", "a")db.vectors.exists("docs", "absent")
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| collection | string | yes | Collection name. |
| key | string | yes | Vector key. |
| 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
StatusValue<bool>
- databoolean
- 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 |