Table of Contents

Method DeleteWhereAsync<TKey, TRecord>

Namespace
Oscova.Agents.Vector
Assembly
Oscova.Agents.dll

DeleteWhereAsync<TKey, TRecord>(string, Expression<Func<TRecord, bool>>, Func<TRecord, TKey>, VectorStoreCollectionDefinition?, CancellationToken)

Deletes every record matching a filter in bounded batches.

public Task<int> DeleteWhereAsync<TKey, TRecord>(string collectionName, Expression<Func<TRecord, bool>> filter, Func<TRecord, TKey> keySelector, VectorStoreCollectionDefinition? definition = null, CancellationToken cancellationToken = default) where TKey : notnull where TRecord : class

Parameters

collectionName string

The collection to update.

filter Expression<Func<TRecord, bool>>

The record filter.

keySelector Func<TRecord, TKey>

Selects the key used for deletion.

definition VectorStoreCollectionDefinition?

An optional collection definition used when opening the collection.

cancellationToken CancellationToken

Cancels enumeration and deletion.

Returns

Task<int>

The number of deleted records.

Type Parameters

TKey

The record key type.

TRecord

The vector record type.