kv

sample

Sample visible KV rows.

strata kv sample

wire kv_sample

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.

To see the complete help for this command, run:

strata kv sample --help

Example

A representative sample plus the total population size.

strata kv put a 1strata kv put b 2strata kv put c 3strata kv sample

Parameters

NameTypeRequiredDescription
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
countinteger or nullnoOptional sample count. Defaults to 10.
prefixanynoOptional key prefix.
spacestring or nullnoTarget product space. Defaults to `"default"`.

Returns

SamplePage<SampleItem>

  • dataobject

    Shared pagination continuation facts.

  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

CodeRetryCommit outcome
failed_precondition.engine.runtime_closednevernot_started
not_found.engine.branchnevernot_applicable
invalid_argument.engine.product_spacenevernot_started
invalid_argument.engine.kv_keynevernot_started
← All 13 Key-value commands

agents: this page as markdown → /docs/reference/kv/sample.md