json
exists
Check whether one JSON document exists.
strata json existsdb.json.exists(key: 'str') -> 'bool'wire json_exists
Returns a boolean status for one JSON document key without loading the stored document.
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 json exists --helphelp(db.json.exists)
Example
Check whether a document exists.
strata json set user $ {"name":"alice"}strata json exists userstrata json exists absent
_ = db.json.set("user", "$", {"name": "alice"})db.json.exists("user")db.json.exists("absent")
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| key | string | yes | Document 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.json_document_id | never | not_started |