Table of Contents

Method Constant

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Constant<TValue>(TValue, IBsonSerializer<TValue>)

Use this method in a MongoDB LINQ query when you need to specify how a constant should be serialized.

public static TValue Constant<TValue>(TValue value, IBsonSerializer<TValue> serializer)

Parameters

value TValue

The value.

serializer IBsonSerializer<TValue>

The serializer.

Returns

TValue

The value.

Type Parameters

TValue

The type of the value.

Constant<TValue>(TValue, BsonType)

Use this method in a MongoDB LINQ query when you need to specify how a constant should be serialized.

public static TValue Constant<TValue>(TValue value, BsonType representaion)

Parameters

value TValue

The value.

representaion BsonType

The representation.

Returns

TValue

The value

Type Parameters

TValue

The type of the value.