Table of Contents

Method Set

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

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

Set an additional field to value using a constant.

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

Parameters

fields ListSetFieldDefinitions<TDocument>

The existing ListSetFieldDefinitions.

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Returns

ListSetFieldDefinitions<TDocument>

The ListSetFieldDefinitions instance with a SetFieldDefinition added.

Type Parameters

TDocument

The type of the document.

TField

The type of the field.

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

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

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

Parameters

fields ListSetFieldDefinitions<TDocument>

The existing ListSetFieldDefinitions.

field Expression<Func<TDocument, TField>>

The field.

value TField

The value.

Returns

ListSetFieldDefinitions<TDocument>

The ListSetFieldDefinitions instance with a SetFieldDefinition added.

Type Parameters

TDocument

The type of the document.

TField

The type of the field.