Class ReplaceOneModel<TDocument>
Model for replacing a single document.
[Serializable]
public sealed class ReplaceOneModel<TDocument> : WriteModel<TDocument>
  Type Parameters
TDocumentThe 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
filterFilterDefinition<TDocument>The filter.
replacementTDocumentThe replacement.
Properties
Collation
Gets or sets the collation.
public Collation Collation { get; set; }
  Property Value
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
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
ModelType
Gets the type of the model.
public override WriteModelType ModelType { get; }
  Property Value
Replacement
Gets the replacement.
public TDocument Replacement { get; }
  Property Value
- TDocument