Table of Contents

Method OfType

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

OfType<TNewResult>(IBsonSerializer<TNewResult>)

Appends a match stage to the pipeline that matches derived documents and changes the result type to the derived type.

IAggregateFluent<TNewResult> OfType<TNewResult>(IBsonSerializer<TNewResult> newResultSerializer = null) where TNewResult : TResult

Parameters

newResultSerializer IBsonSerializer<TNewResult>

The new result serializer.

Returns

IAggregateFluent<TNewResult>

The fluent aggregate interface.

Type Parameters

TNewResult

The type of the derived documents.