Docs menu · Reference

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

NameTypeRequiredDescription
countintegernoOptional sample count. Defaults to 10.
prefixBytesnoOptional key prefix.

Plus the optional scope: branch and space (default to the session branch and the "default" space).

Returns

SamplePage<SampleItem>.

Errors

Invocation

  • CLI: strata kv sample
  • Wire type: kv_sample

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