Method Update
Update(IMongoQuery, IMongoUpdate)
Updates one matching document in this collection.
public virtual WriteConcernResult Update(IMongoQuery query, IMongoUpdate update)
Parameters
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
update
IMongoUpdateThe 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
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
update
IMongoUpdateThe update to perform on the matching document.
options
MongoUpdateOptionsThe 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
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
update
IMongoUpdateThe update to perform on the matching document.
writeConcern
WriteConcernThe 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
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
update
IMongoUpdateThe update to perform on the matching document.
flags
UpdateFlagsThe 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
query
IMongoQueryThe query (usually a QueryDocument or constructed using the Query builder).
update
IMongoUpdateThe update to perform on the matching document.
flags
UpdateFlagsThe flags for this Update.
writeConcern
WriteConcernThe write concern to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).