Method Field

| MongoDB CSharp Driver API Reference (original) (raw)

Namespace

MongoDB.Driver

Assembly

MongoDB.Driver.dll

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

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

The field serializer.

Returns

TField

The value of the field.

Type Parameters

TDocument

The type of the document.

TField

The type of the field.