Click or drag to resize
MongoCollectionBase<TDocument>.UpdateOne Method
Updates a single document.

Namespace: MongoDB.Driver
Assembly: MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.4.1
Syntax
public virtual UpdateResult UpdateOne(
	FilterDefinition<TDocument> filter,
	UpdateDefinition<TDocument> update,
	UpdateOptions options = null,
	CancellationToken cancellationToken = null
)

Parameters

filter
Type: MongoDB.Driver.FilterDefinition<TDocument>
The filter.
update
Type: MongoDB.Driver.UpdateDefinition<TDocument>
The update.
options (Optional)
Type: MongoDB.Driver.UpdateOptions
The options.
cancellationToken (Optional)
Type: System.Threading.CancellationToken
The cancellation token.

Return Value

Type: UpdateResult
The result of the update operation.

Implements

IMongoCollection<TDocument>.UpdateOne(FilterDefinition<TDocument>, UpdateDefinition<TDocument>, UpdateOptions, CancellationToken)
See Also