Method UpdateMany
UpdateMany(FilterDefinition<TDocument>, UpdateDefinition<TDocument>, UpdateOptions, CancellationToken)
Updates many documents.
UpdateResult UpdateMany(FilterDefinition<TDocument> filter, UpdateDefinition<TDocument> update, UpdateOptions options = null, CancellationToken cancellationToken = default)
Parameters
filter
FilterDefinition<TDocument>The filter.
update
UpdateDefinition<TDocument>The update.
options
UpdateOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- UpdateResult
The result of the update operation.
UpdateMany(IClientSessionHandle, FilterDefinition<TDocument>, UpdateDefinition<TDocument>, UpdateOptions, CancellationToken)
Updates many documents.
UpdateResult UpdateMany(IClientSessionHandle session, FilterDefinition<TDocument> filter, UpdateDefinition<TDocument> update, UpdateOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSessionHandleThe session.
filter
FilterDefinition<TDocument>The filter.
update
UpdateDefinition<TDocument>The update.
options
UpdateOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- UpdateResult
The result of the update operation.