Table of Contents

Class ConstantSetFieldDefinition<TDocument, TField>

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

A SetFieldDefinition that uses a field and a a constant to define the field to be set.

public sealed class ConstantSetFieldDefinition<TDocument, TField> : SetFieldDefinition<TDocument>

Type Parameters

TDocument

The type of the document.

TField

The type of the field.

Inheritance
ConstantSetFieldDefinition<TDocument, TField>
Inherited Members

Constructors

ConstantSetFieldDefinition(FieldDefinition<TDocument, TField>, TField)

Initializes an instance of ConstantSetFieldDefinition.

public ConstantSetFieldDefinition(FieldDefinition<TDocument, TField> field, TField value)

Parameters

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Methods

Render(IBsonSerializer<TDocument>, IBsonSerializerRegistry, LinqProvider)

Renders the SetFieldDefinition.

public override BsonElement Render(IBsonSerializer<TDocument> documentSerializer, IBsonSerializerRegistry serializerRegistry, LinqProvider linqProvider)

Parameters

documentSerializer IBsonSerializer<TDocument>

The document serializer.

serializerRegistry IBsonSerializerRegistry

The serializer registry.

linqProvider LinqProvider

The linq provider.

Returns

BsonElement

The rendered SetFieldDefinition.