Table of Contents

Method Field

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Field<TDocument, TField>(TDocument, string, IBsonSerializer<TField>)

Gets the value of a field in a document.

public static TField Field<TDocument, TField>(TDocument document, string fieldName, IBsonSerializer<TField> fieldSerializer)

Parameters

document TDocument

The document.

fieldName string

The field name.

fieldSerializer IBsonSerializer<TField>

The field serializer.

Returns

TField

The value of the field.

Type Parameters

TDocument

The type of the document.

TField

The type of the field.