kv

batch_get

Read multiple KV values by key.

db.kv.get_many(keys: 'Sequence[str | bytes]') -> 'list[Optional[bytes]]'

wire kv_batch_get

Reads several KV keys and returns positional item results. Each item records whether the corresponding key was found and includes value metadata when present.

Itemwise batches return one positional item result per input item. The outer batch status summarizes whether all, some, or none of the items succeeded.

To see the complete help for this command, run:

help(db.kv.get_many)

Example

Read many keys at once; a missing key comes back as null.

_ = db.kv.put_many([{"key": "a", "value": "1"}, {"key": "b", "value": "2"}])db.kv.get_many(["a", "b", "missing"])

Parameters

NameTypeRequiredDescription
keysarrayyesKeys to read.
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
spacestring or nullnoTarget product space. Defaults to `"default"`.

Returns

BatchResult<Maybe<Bytes>>

  • dataBatchResult2
  • typestring

Errors

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

← All 13 Key-value commands

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