Table of Contents

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 UpdateType

The update type.

filter BsonDocument

The filter.

update BsonValue

The 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

Collation

Filter

Gets the filter.

public BsonDocument Filter { get; }

Property Value

BsonDocument

Hint

Gets or sets the hint.

public BsonValue Hint { get; set; }

Property Value

BsonValue

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

BsonValue

UpdateType

Gets the update type.

public UpdateType UpdateType { get; }

Property Value

UpdateType

Methods

IsRetryable(ConnectionDescription)

Determines whether the request is retryable on a given connection.

public override bool IsRetryable(ConnectionDescription connectionDescription)

Parameters

connectionDescription ConnectionDescription

The connection description.

Returns

bool

true if the request is retryable; otherwise, false.