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

This method updates or inserts a record 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(Dictionary<string, object?> record, CancellationToken cancellationToken = default);

Parameters

  • record

    The record 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

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