vector

batch_upsert

Upsert multiple vectors in one itemwise batch.

db.vectors.upsert_many(collection: 'str', entries: 'Any') -> 'BatchResult'

wire vector_batch_upsert

Writes multiple vector entries and returns positional mutation results. Valid items share commit facts where the 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.vectors.upsert_many)

Example

Upsert many vectors in one commit.

_ = db.vectors.create_collection("docs", 3, metric="cosine")_ = db.vectors.upsert_many("docs", [{"key": "a", "vector": [1.0, 0.0, 0.0]}, {"key": "b", "vector": [0.0, 1.0, 0.0]}])db.vectors.count("docs")

Parameters

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

Returns

BatchResult<VectorMutationItem>

  • dataBatchResult7
  • typestring

Errors

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

← All 22 Vectors commands

agents: this page as markdown → /docs/reference/vector/batch_upsert.md