Table of Contents

Method FindAndRemove

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Legacy.dll

FindAndRemove(IMongoQuery, IMongoSortBy)

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

[Obsolete("Use the overload of FindAndRemove that has a FindAndRemoveArgs parameter instead.")]
public virtual FindAndModifyResult FindAndRemove(IMongoQuery query, IMongoSortBy sortBy)

Parameters

query IMongoQuery

The query (usually a QueryDocument or constructed using the Query builder).

sortBy IMongoSortBy

The sort order to select one of the matching documents.

Returns

FindAndModifyResult

A FindAndModifyResult.

FindAndRemove(FindAndRemoveArgs)

Finds one matching document using the supplied args and removes it from this collection.

public virtual FindAndModifyResult FindAndRemove(FindAndRemoveArgs args)

Parameters

args FindAndRemoveArgs

The args.

Returns

FindAndModifyResult

A FindAndModifyResult.