Reads the JSON value at a path inside a document. Current reads return the value with commit metadata; passing a timestamp returns the bare value visible at that point in time. A missing document or path is a found-false result, distinct from a stored JSON null.
Optional reads distinguish present data from missing data. When version or timestamp facts exist on the executor output, SDK mappings should preserve them.
Examples
Read a whole document, a value at a JSON path, or nothing.
CLI
$ strata json set user $ {"age":30,"name":"alice"}
$ strata json get user $
$ strata json get user $.name
$ strata json get absent $
Wire
{"key":"user","path":"$","type":"json_set","value":{"age":30,"name":"alice"}}
{"key":"user","path":"$","type":"json_get"}
{"key":"user","path":"$.name","type":"json_get"}
{"key":"absent","path":"$","type":"json_get"}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
as_of | integer | no | Optional timestamp in microseconds. |
key | string | yes | Document key. |
path | string | yes | JSON path. |
Plus the optional scope: branch and space (default to the session branch and the "default" space).
Returns
Maybe<JsonVersionedValue> — a miss returns nothing rather than raising.
Errors
failed_precondition.engine.runtime_closednot_found.engine.branchinvalid_argument.engine.product_spaceinvalid_argument.engine.json_document_idinvalid_argument.engine.json_pathinvalid_argument.engine.json_path_too_long
Invocation
- CLI:
strata json get - Wire type:
json_get