Docs menu · Reference

Counts visible KV keys in the selected branch and space, optionally constrained by a key prefix.

Status commands return a scalar or compact status payload and do not mutate database state.

Examples

Count the visible keys.

CLI

$ strata kv put a 1
$ strata kv put b 2
$ strata kv count

Wire

{"key":"YQ==","type":"kv_put","value":"MQ=="}
{"key":"Yg==","type":"kv_put","value":"Mg=="}
{"type":"kv_count"}

Parameters

NameTypeRequiredDescription
as_ofintegernoOptional timestamp in microseconds.
prefixBytesnoOptional key prefix.

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

Returns

StatusValue<u64>.

Errors

Invocation

  • CLI: strata kv count
  • Wire type: kv_count

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