kv

batch_put

Store multiple KV values in one itemwise batch.

db.kv.put_many(entries: 'Any') -> 'BatchResult'

wire kv_batch_put

Writes multiple KV entries using the executor batch contract. Valid items share commit facts where the underlying engine applies them together.

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.put_many)

Example

Write many entries in one commit.

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

Parameters

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

Returns

BatchResult<KvMutationItem>

  • dataBatchResult
  • 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_put.md