UpsertAsync(IEnumerable<Dictionary<string, object?>>, CancellationToken)

This method updates or inserts a batch of records into the vector store. It does not guarantee the existence of the collection. If the record already exists, it is updated; if it does not exist, it is created.

Declaration

// C#
public async Task UpsertAsync(IEnumerable<Dictionary<string, object?>> records, CancellationToken cancellationToken = default);

Parameters

  • records

    The records to update or insert.

  • cancellationToken

    The cancellation token.

Return Value

Task representing the asynchronous operation when the records are updated or inserted.

Implements

Microsoft.Extensions.VectorData.VectorStoreCollection

Exceptions

VectorStoreException: The command fails to execute for any reason other than the absence of a record.

Remarks

All records are upserted when succeed or none when fails.

Unlike OracleCollection, OracleDynamicColloection uses Object as TKey, and Dictionary<string, object?> as TRecord. Please make sure to use the correct parameter types, IEnumerable<Dictionary<string, object?>> for records.