Method DeleteOne
DeleteOne(FilterDefinition<TDocument>, CancellationToken)
Deletes a single document.
public virtual DeleteResult DeleteOne(FilterDefinition<TDocument> filter, CancellationToken cancellationToken = default)
Parameters
filter
FilterDefinition<TDocument>The filter.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- DeleteResult
The result of the delete operation.
DeleteOne(FilterDefinition<TDocument>, DeleteOptions, CancellationToken)
Deletes a single document.
public virtual DeleteResult DeleteOne(FilterDefinition<TDocument> filter, DeleteOptions options, CancellationToken cancellationToken = default)
Parameters
filter
FilterDefinition<TDocument>The filter.
options
DeleteOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- DeleteResult
The result of the delete operation.
DeleteOne(IClientSessionHandle, FilterDefinition<TDocument>, DeleteOptions, CancellationToken)
Deletes a single document.
public virtual DeleteResult DeleteOne(IClientSessionHandle session, FilterDefinition<TDocument> filter, DeleteOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSessionHandleThe session.
filter
FilterDefinition<TDocument>The filter.
options
DeleteOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- DeleteResult
The result of the delete operation.