Table of Contents

Method Type

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Type(FieldDefinition<TDocument>, BsonType)

Creates a type filter.

public FilterDefinition<TDocument> Type(FieldDefinition<TDocument> field, BsonType type)

Parameters

field FieldDefinition<TDocument>

The field.

type BsonType

The type.

Returns

FilterDefinition<TDocument>

A type filter.

Type(FieldDefinition<TDocument>, string)

Creates a type filter.

public FilterDefinition<TDocument> Type(FieldDefinition<TDocument> field, string type)

Parameters

field FieldDefinition<TDocument>

The field.

type string

The type.

Returns

FilterDefinition<TDocument>

A type filter.

Type(Expression<Func<TDocument, object>>, BsonType)

Creates a type filter.

public FilterDefinition<TDocument> Type(Expression<Func<TDocument, object>> field, BsonType type)

Parameters

field Expression<Func<TDocument, object>>

The field.

type BsonType

The type.

Returns

FilterDefinition<TDocument>

A type filter.

Type(Expression<Func<TDocument, object>>, string)

Creates a type filter.

public FilterDefinition<TDocument> Type(Expression<Func<TDocument, object>> field, string type)

Parameters

field Expression<Func<TDocument, object>>

The field.

type string

The type.

Returns

FilterDefinition<TDocument>

A type filter.