Method Convert
Convert<TFrom, TTo>(TFrom, ConvertOptions<TTo>)
Converts a value from one type to another using the $convert aggregation operator.
public static TTo Convert<TFrom, TTo>(TFrom value, ConvertOptions<TTo> options)
Parameters
value
TFromThe value to convert.
options
ConvertOptions<TTo>The conversion options.
Returns
- TTo
The converted value.
Type Parameters
TFrom
The type of the input value.
TTo
The type of the output value.
Remarks
Not all conversions are supported by the $convert operator.