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
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
sortByIMongoSortByThe sort order to select one of the matching documents.
updateIMongoUpdateThe 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
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
sortByIMongoSortByThe sort order to select one of the matching documents.
updateIMongoUpdateThe update to apply to the matching document.
returnNewboolWhether 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
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
sortByIMongoSortByThe sort order to select one of the matching documents.
updateIMongoUpdateThe update to apply to the matching document.
returnNewboolWhether to return the new or old version of the modified document in the FindAndModifyResult.
upsertboolWhether 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
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
sortByIMongoSortByThe sort order to select one of the matching documents.
updateIMongoUpdateThe update to apply to the matching document.
fieldsIMongoFieldsWhich fields of the modified document to return in the FindAndModifyResult.
returnNewboolWhether to return the new or old version of the modified document in the FindAndModifyResult.
upsertboolWhether 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
argsFindAndModifyArgsThe args.