kv
exists
Check whether one KV key exists.
strata kv existsdb.kv.exists(key: 'str | bytes') -> 'bool'wire kv_exists
Returns a boolean status for one KV key without loading the stored value.
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 kv exists --helphelp(db.kv.exists)
Example
Check whether a key currently has a visible value.
strata kv put k vstrata kv exists kstrata kv exists absent
_ = db.kv.put("k", "v")db.kv.exists("k")db.kv.exists("absent")
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| key | Bytes | yes | Key to check. |
| 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.kv_key | never | not_started |