Returns a deterministic bounded sample of visible KV rows plus the total matching count.
Paginated responses use opaque cursors. Clients should pass the returned cursor back to the same command shape and must not parse cursor contents.
Examples
A representative sample plus the total population size.
CLI
$ strata command run --command-json '{"entries":[{"key":"YQ==","value":"MQ=="},{"key":"Yg==","value":"Mg=="},{"key":"Yw==","value":"Mw=="}],"type":"kv_batch_put"}'
$ strata kv sample
Wire
{"entries":[{"key":"YQ==","value":"MQ=="},{"key":"Yg==","value":"Mg=="},{"key":"Yw==","value":"Mw=="}],"type":"kv_batch_put"}
{"type":"kv_sample"}
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
count | integer | no | Optional sample count. Defaults to 10. |
prefix | Bytes | no | Optional key prefix. |
Plus the optional scope: branch and space (default to the session branch and the "default" space).
Returns
SamplePage<SampleItem>.
Errors
failed_precondition.engine.runtime_closednot_found.engine.branchinvalid_argument.engine.product_spaceinvalid_argument.engine.kv_key
Invocation
- CLI:
strata kv sample - Wire type:
kv_sample