Table of Contents

Method Set

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Set<TField>(FieldDefinition<TDocument, TField>, TField)

Set a field to a value using a constant.

public ListSetFieldDefinitions<TDocument> Set<TField>(FieldDefinition<TDocument, TField> field, TField value)

Parameters

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Returns

ListSetFieldDefinitions<TDocument>

An instance of ListSetFieldDefinitions to which further set field definitions can be added.

Type Parameters

TField

The type of the field.

Set<TField>(Expression<Func<TDocument, TField>>, TField)

Set a field to a value using an expression to specify the field and a constant to specify the value.

public ListSetFieldDefinitions<TDocument> Set<TField>(Expression<Func<TDocument, TField>> field, TField value)

Parameters

field Expression<Func<TDocument, TField>>

The field.

value TField

The value.

Returns

ListSetFieldDefinitions<TDocument>

An instance of ListSetFieldDefinitions to which further set field definitions can be added.

Type Parameters

TField

The type of the field.