Class UpdateRequest
- Namespace
- MongoDB.Driver.Core.Operations
- Assembly
- MongoDB.Driver.Core.dll
Represents a request to update one or more documents.
public sealed class UpdateRequest : WriteRequest
- Inheritance
-
UpdateRequest
- Inherited Members
Constructors
UpdateRequest(UpdateType, BsonDocument, BsonValue)
Initializes a new instance of the UpdateRequest class.
public UpdateRequest(UpdateType updateType, BsonDocument filter, BsonValue update)
Parameters
updateType
UpdateTypeThe update type.
filter
BsonDocumentThe filter.
update
BsonValueThe update.
Properties
ArrayFilters
Gets or sets the array filters.
public IEnumerable<BsonDocument> ArrayFilters { get; set; }
Property Value
- IEnumerable<BsonDocument>
The array filters.
Collation
Gets or sets the collation.
public Collation Collation { get; set; }
Property Value
Filter
Gets the filter.
public BsonDocument Filter { get; }
Property Value
Hint
Gets or sets the hint.
public BsonValue Hint { get; set; }
Property Value
IsMulti
Gets or sets a value indicating whether this update should affect all matching documents.
public bool IsMulti { get; set; }
Property Value
- bool
true
if this update should affect all matching documents; otherwise,false
.
IsUpsert
Gets or sets a value indicating whether a document should be inserted if no matching document is found.
public bool IsUpsert { get; set; }
Property Value
- bool
true
if a document should be inserted if no matching document is found; otherwise,false
.
Update
Gets the update specification.
public BsonValue Update { get; }
Property Value
UpdateType
Gets the update type.
public UpdateType UpdateType { get; }
Property Value
Methods
IsRetryable(ConnectionDescription)
Determines whether the request is retryable on a given connection.
public override bool IsRetryable(ConnectionDescription connectionDescription)
Parameters
connectionDescription
ConnectionDescriptionThe connection description.
Returns
- bool
true
if the request is retryable; otherwise,false
.