Table of Contents

Method UpsertBatchAsync

Namespace
LMKit.Data.Storage
Assembly
LM-Kit.NET.dll

UpsertBatchAsync(string, IEnumerable<(string Id, float[] Vectors, MetadataCollection Metadata)>, CancellationToken)

Asynchronously inserts or updates multiple vector entries in the specified collection in a single batch operation. This method is more efficient than calling UpsertAsync(string, string, float[], MetadataCollection, CancellationToken) repeatedly for bulk operations.

Task UpsertBatchAsync(string collectionIdentifier, IEnumerable<(string Id, float[] Vectors, MetadataCollection Metadata)> points, CancellationToken cancellationToken = default)

Parameters

collectionIdentifier string

The name of the collection in which the vectors will be stored.

points IEnumerable<(string Id, float[] Vectors, MetadataCollection Metadata)>

A collection of tuples, each containing an ID, vector data, and metadata for a single entry. All vector arrays must match the vector size defined for the collection.

cancellationToken CancellationToken

An optional cancellation token to cancel the asynchronous batch upsert operation.

Returns

Task

A task representing the asynchronous batch upsert operation.