Method FindAndModify
FindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate)
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
[Obsolete("Use the overload of FindAndModify that has a FindAndModifyArgs parameter instead.")]
public virtual FindAndModifyResult FindAndModify(IMongoQuery query, IMongoSortBy sortBy, IMongoUpdate update)
Parameters
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
sortBy
IMongoSortByThe sort order to select one of the matching documents.
update
IMongoUpdateThe update to apply to the matching document.
Returns
FindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, bool)
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
[Obsolete("Use the overload of FindAndModify that has a FindAndModifyArgs parameter instead.")]
public virtual FindAndModifyResult FindAndModify(IMongoQuery query, IMongoSortBy sortBy, IMongoUpdate update, bool returnNew)
Parameters
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
sortBy
IMongoSortByThe sort order to select one of the matching documents.
update
IMongoUpdateThe update to apply to the matching document.
returnNew
boolWhether to return the new or old version of the modified document in the FindAndModifyResult.
Returns
FindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, bool, bool)
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
[Obsolete("Use the overload of FindAndModify that has a FindAndModifyArgs parameter instead.")]
public virtual FindAndModifyResult FindAndModify(IMongoQuery query, IMongoSortBy sortBy, IMongoUpdate update, bool returnNew, bool upsert)
Parameters
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
sortBy
IMongoSortByThe sort order to select one of the matching documents.
update
IMongoUpdateThe update to apply to the matching document.
returnNew
boolWhether to return the new or old version of the modified document in the FindAndModifyResult.
upsert
boolWhether to do an upsert if no matching document is found.
Returns
FindAndModify(IMongoQuery, IMongoSortBy, IMongoUpdate, IMongoFields, bool, bool)
Finds one matching document using the query and sortBy parameters and applies the specified update to it.
[Obsolete("Use the overload of FindAndModify that has a FindAndModifyArgs parameter instead.")]
public virtual FindAndModifyResult FindAndModify(IMongoQuery query, IMongoSortBy sortBy, IMongoUpdate update, IMongoFields fields, bool returnNew, bool upsert)
Parameters
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
sortBy
IMongoSortByThe sort order to select one of the matching documents.
update
IMongoUpdateThe update to apply to the matching document.
fields
IMongoFieldsWhich fields of the modified document to return in the FindAndModifyResult.
returnNew
boolWhether to return the new or old version of the modified document in the FindAndModifyResult.
upsert
boolWhether to do an upsert if no matching document is found.
Returns
FindAndModify(FindAndModifyArgs)
Finds one matching document using the supplied arguments and applies the specified update to it.
public virtual FindAndModifyResult FindAndModify(FindAndModifyArgs args)
Parameters
args
FindAndModifyArgsThe args.