Class UpdateOneModel<TDocument>
Model for updating a single document.
[Serializable]
public sealed class UpdateOneModel<TDocument> : WriteModel<TDocument>
  Type Parameters
TDocumentThe type of the document.
- Inheritance
 - 
      
      WriteModel<TDocument>UpdateOneModel<TDocument>
 
- Inherited Members
 
Constructors
UpdateOneModel(FilterDefinition<TDocument>, UpdateDefinition<TDocument>)
Initializes a new instance of the UpdateOneModel<TDocument> class.
public UpdateOneModel(FilterDefinition<TDocument> filter, UpdateDefinition<TDocument> update)
  Parameters
filterFilterDefinition<TDocument>The filter.
updateUpdateDefinition<TDocument>The update.
Properties
ArrayFilters
Gets or sets the array filters.
public IEnumerable<ArrayFilterDefinition> ArrayFilters { get; set; }
  Property Value
- IEnumerable<ArrayFilterDefinition>
 The array filters.
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
Update
Gets the update.
public UpdateDefinition<TDocument> Update { get; }
  Property Value
- UpdateDefinition<TDocument>
 
Methods
ThrowIfNotValid()
Validate model.
public override void ThrowIfNotValid()