Table of Contents

Class ReplaceOneModel<TDocument>

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Model for replacing a single document.

[Serializable]
public sealed class ReplaceOneModel<TDocument> : WriteModel<TDocument>

Type Parameters

TDocument

The type of the document.

Inheritance
WriteModel<TDocument>
ReplaceOneModel<TDocument>
Inherited Members

Constructors

ReplaceOneModel(FilterDefinition<TDocument>, TDocument)

Initializes a new instance of the ReplaceOneModel<TDocument> class.

public ReplaceOneModel(FilterDefinition<TDocument> filter, TDocument replacement)

Parameters

filter FilterDefinition<TDocument>

The filter.

replacement TDocument

The replacement.

Properties

Collation

Gets or sets the collation.

public Collation Collation { get; set; }

Property Value

Collation

Filter

Gets the filter.

public FilterDefinition<TDocument> Filter { get; }

Property Value

FilterDefinition<TDocument>

Hint

Gets or sets the hint.

public BsonValue Hint { get; set; }

Property Value

BsonValue

IsUpsert

Gets or sets a value indicating whether to insert the document if it doesn't already exist.

public bool IsUpsert { get; set; }

Property Value

bool

ModelType

Gets the type of the model.

public override WriteModelType ModelType { get; }

Property Value

WriteModelType

Replacement

Gets the replacement.

public TDocument Replacement { get; }

Property Value

TDocument