Docs menu · Reference

Counts visible JSON documents in the selected branch and space, optionally constrained by a document key prefix.

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

Examples

Count stored documents.

CLI

$ strata json set a $ {"v":1}
$ strata json set b $ {"v":2}
$ strata json count

Wire

{"key":"a","path":"$","type":"json_set","value":{"v":1}}
{"key":"b","path":"$","type":"json_set","value":{"v":2}}
{"type":"json_count"}

Parameters

NameTypeRequiredDescription
as_ofintegernoOptional timestamp in microseconds.
prefixstringnoOptional document 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 json count
  • Wire type: json_count

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