Method Update
Update(IMongoQuery, IMongoUpdate)
Updates one matching document in this collection.
public virtual WriteConcernResult Update(IMongoQuery query, IMongoUpdate update)
Parameters
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
updateIMongoUpdateThe update to perform on the matching document.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Update(IMongoQuery, IMongoUpdate, MongoUpdateOptions)
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
public virtual WriteConcernResult Update(IMongoQuery query, IMongoUpdate update, MongoUpdateOptions options)
Parameters
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
updateIMongoUpdateThe update to perform on the matching document.
optionsMongoUpdateOptionsThe update options.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Update(IMongoQuery, IMongoUpdate, WriteConcern)
Updates one matching document in this collection.
public virtual WriteConcernResult Update(IMongoQuery query, IMongoUpdate update, WriteConcern writeConcern)
Parameters
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
updateIMongoUpdateThe update to perform on the matching document.
writeConcernWriteConcernThe write concern to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Update(IMongoQuery, IMongoUpdate, UpdateFlags)
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
public virtual WriteConcernResult Update(IMongoQuery query, IMongoUpdate update, UpdateFlags flags)
Parameters
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
updateIMongoUpdateThe update to perform on the matching document.
flagsUpdateFlagsThe flags for this Update.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Update(IMongoQuery, IMongoUpdate, UpdateFlags, WriteConcern)
Updates one or more matching documents in this collection (for multiple updates use UpdateFlags.Multi).
public virtual WriteConcernResult Update(IMongoQuery query, IMongoUpdate update, UpdateFlags flags, WriteConcern writeConcern)
Parameters
queryIMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
updateIMongoUpdateThe update to perform on the matching document.
flagsUpdateFlagsThe flags for this Update.
writeConcernWriteConcernThe write concern to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).