Share via


AzureCosmosDBNoSQLVectorStoreRecordCollection<TRecord>.UpsertBatchAsync Method

Definition

Upserts a group of records into the vector store. Does not guarantee that the collection exists. If the record already exists, it will be updated. If the record does not exist, it will be created. Upserts will be made in a single request or in a single parallel batch depending on the available store functionality.

public System.Collections.Generic.IAsyncEnumerable<string> UpsertBatchAsync (System.Collections.Generic.IEnumerable<TRecord> records, Microsoft.SemanticKernel.Data.UpsertRecordOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UpsertBatchAsync : seq<'Record (requires 'Record : null)> * Microsoft.SemanticKernel.Data.UpsertRecordOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<string>
override this.UpsertBatchAsync : seq<'Record (requires 'Record : null)> * Microsoft.SemanticKernel.Data.UpsertRecordOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<string>
Public Function UpsertBatchAsync (records As IEnumerable(Of TRecord), Optional options As UpsertRecordOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of String)

Parameters

records
IEnumerable<TRecord>

The records to upsert.

options
UpsertRecordOptions

Optional options for upserting the records.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

The unique identifiers for the records.

Implements

Applies to