Click or drag to resize

MongoCollectionFindAndRemove Method (IMongoQuery, IMongoSortBy)

Note: This API is now obsolete.

Finds one matching document using the query and sortBy parameters and removes it from this collection.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver.Legacy (in MongoDB.Driver.Legacy.dll) Version: 2.13.1-v2-13-x1+a7f8afe27855f38f4f72157d11ba2ae73895502e
Syntax
[ObsoleteAttribute("Use the overload of FindAndRemove that has a FindAndRemoveArgs parameter instead.")]
public virtual FindAndModifyResult FindAndRemove(
	IMongoQuery query,
	IMongoSortBy sortBy
)

Parameters

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

Return Value

Type: FindAndModifyResult
A FindAndModifyResult.
See Also