Click or drag to resize

MongoCollectionFindAndModify Method (IMongoQuery, IMongoSortBy, IMongoUpdate)

Note: This API is now obsolete.

Finds one matching document using the query and sortBy parameters and applies the specified update to it.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver.Legacy (in MongoDB.Driver.Legacy.dll) Version: 2.10.0+569905ff5e778c38ea19d9d0392496a83e1704ed
[ObsoleteAttribute("Use the overload of FindAndModify that has a FindAndModifyArgs parameter instead.")]
public virtual FindAndModifyResult FindAndModify(
	IMongoQuery query,
	IMongoSortBy sortBy,
	IMongoUpdate update


Type: MongoDB.DriverIMongoQuery
The query (usually a QueryDocument or constructed using the Query builder).
Type: MongoDB.DriverIMongoSortBy
The sort order to select one of the matching documents.
Type: MongoDB.DriverIMongoUpdate
The update to apply to the matching document.

Return Value

Type: FindAndModifyResult
A FindAndModifyResult.
See Also