Table of Contents

Class FilterDefinitionBuilder<TDocument>

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

A builder for a FilterDefinition<TDocument>.

public sealed class FilterDefinitionBuilder<TDocument>

Type Parameters

TDocument

The type of the document.

Inheritance
FilterDefinitionBuilder<TDocument>
Inherited Members

Properties

Empty

Gets an empty filter. An empty filter matches everything.

public FilterDefinition<TDocument> Empty { get; }

Property Value

FilterDefinition<TDocument>

Methods

All<TItem>(FieldDefinition<TDocument>, IEnumerable<TItem>)

Creates an all filter for an array field.

public FilterDefinition<TDocument> All<TItem>(FieldDefinition<TDocument> field, IEnumerable<TItem> values)

Parameters

field FieldDefinition<TDocument>

The field.

values IEnumerable<TItem>

The values.

Returns

FilterDefinition<TDocument>

An all filter.

Type Parameters

TItem

The type of the item.

All<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, IEnumerable<TItem>)

Creates an all filter for an array field.

public FilterDefinition<TDocument> All<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, IEnumerable<TItem> values)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

values IEnumerable<TItem>

The values.

Returns

FilterDefinition<TDocument>

An all filter.

Type Parameters

TItem

The type of the item.

And(params FilterDefinition<TDocument>[])

Creates an and filter.

public FilterDefinition<TDocument> And(params FilterDefinition<TDocument>[] filters)

Parameters

filters FilterDefinition<TDocument>[]

The filters.

Returns

FilterDefinition<TDocument>

A filter.

And(IEnumerable<FilterDefinition<TDocument>>)

Creates an and filter.

public FilterDefinition<TDocument> And(IEnumerable<FilterDefinition<TDocument>> filters)

Parameters

filters IEnumerable<FilterDefinition<TDocument>>

The filters.

Returns

FilterDefinition<TDocument>

An and filter.

AnyEq<TItem>(FieldDefinition<TDocument>, TItem)

Creates an equality filter for an array field.

public FilterDefinition<TDocument> AnyEq<TItem>(FieldDefinition<TDocument> field, TItem value)

Parameters

field FieldDefinition<TDocument>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

An equality filter.

Type Parameters

TItem

The type of the item.

AnyEq<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)

Creates an equality filter for an array field.

public FilterDefinition<TDocument> AnyEq<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

An equality filter.

Type Parameters

TItem

The type of the item.

AnyGt<TItem>(FieldDefinition<TDocument>, TItem)

Creates a greater than filter for an array field.

public FilterDefinition<TDocument> AnyGt<TItem>(FieldDefinition<TDocument> field, TItem value)

Parameters

field FieldDefinition<TDocument>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A greater than filter.

Type Parameters

TItem

The type of the item.

AnyGt<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)

Creates a greater than filter for an array field.

public FilterDefinition<TDocument> AnyGt<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A greater than filter.

Type Parameters

TItem

The type of the item.

AnyGte<TItem>(FieldDefinition<TDocument>, TItem)

Creates a greater than or equal filter for an array field.

public FilterDefinition<TDocument> AnyGte<TItem>(FieldDefinition<TDocument> field, TItem value)

Parameters

field FieldDefinition<TDocument>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A greater than or equal filter.

Type Parameters

TItem

The type of the item.

AnyGte<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)

Creates a greater than or equal filter for an array field.

public FilterDefinition<TDocument> AnyGte<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A greater than or equal filter.

Type Parameters

TItem

The type of the item.

AnyIn<TItem>(FieldDefinition<TDocument>, IEnumerable<TItem>)

Creates an in filter for an array field.

public FilterDefinition<TDocument> AnyIn<TItem>(FieldDefinition<TDocument> field, IEnumerable<TItem> values)

Parameters

field FieldDefinition<TDocument>

The field.

values IEnumerable<TItem>

The values.

Returns

FilterDefinition<TDocument>

An in filter.

Type Parameters

TItem

The type of the item.

AnyIn<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, IEnumerable<TItem>)

Creates an in filter for an array field.

public FilterDefinition<TDocument> AnyIn<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, IEnumerable<TItem> values)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

values IEnumerable<TItem>

The values.

Returns

FilterDefinition<TDocument>

An in filter.

Type Parameters

TItem

The type of the item.

AnyLt<TItem>(FieldDefinition<TDocument>, TItem)

Creates a less than filter for an array field.

public FilterDefinition<TDocument> AnyLt<TItem>(FieldDefinition<TDocument> field, TItem value)

Parameters

field FieldDefinition<TDocument>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A less than filter.

Type Parameters

TItem

The type of the item.

AnyLt<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)

Creates a less than filter for an array field.

public FilterDefinition<TDocument> AnyLt<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A less than filter.

Type Parameters

TItem

The type of the item.

AnyLte<TItem>(FieldDefinition<TDocument>, TItem)

Creates a less than or equal filter for an array field.

public FilterDefinition<TDocument> AnyLte<TItem>(FieldDefinition<TDocument> field, TItem value)

Parameters

field FieldDefinition<TDocument>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A less than or equal filter.

Type Parameters

TItem

The type of the item.

AnyLte<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)

Creates a less than or equal filter for an array field.

public FilterDefinition<TDocument> AnyLte<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A less than or equal filter.

Type Parameters

TItem

The type of the item.

AnyNe<TItem>(FieldDefinition<TDocument>, TItem)

Creates a not equal filter for an array field.

public FilterDefinition<TDocument> AnyNe<TItem>(FieldDefinition<TDocument> field, TItem value)

Parameters

field FieldDefinition<TDocument>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A not equal filter.

Type Parameters

TItem

The type of the item.

AnyNe<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, TItem)

Creates a not equal filter for an array field.

public FilterDefinition<TDocument> AnyNe<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, TItem value)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

value TItem

The value.

Returns

FilterDefinition<TDocument>

A not equal filter.

Type Parameters

TItem

The type of the item.

AnyNin<TItem>(FieldDefinition<TDocument>, IEnumerable<TItem>)

Creates a not in filter for an array field.

public FilterDefinition<TDocument> AnyNin<TItem>(FieldDefinition<TDocument> field, IEnumerable<TItem> values)

Parameters

field FieldDefinition<TDocument>

The field.

values IEnumerable<TItem>

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

Type Parameters

TItem

The type of the item.

AnyNin<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, IEnumerable<TItem>)

Creates a not in filter for an array field.

public FilterDefinition<TDocument> AnyNin<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, IEnumerable<TItem> values)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

values IEnumerable<TItem>

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

Type Parameters

TItem

The type of the item.

AnyStringIn(FieldDefinition<TDocument, IEnumerable<string>>, params StringOrRegularExpression[])

Creates an in filter for a string array field.

public FilterDefinition<TDocument> AnyStringIn(FieldDefinition<TDocument, IEnumerable<string>> field, params StringOrRegularExpression[] values)

Parameters

field FieldDefinition<TDocument, IEnumerable<string>>

The field.

values StringOrRegularExpression[]

The values.

Returns

FilterDefinition<TDocument>

An in filter.

AnyStringIn(FieldDefinition<TDocument, IEnumerable<string>>, IEnumerable<StringOrRegularExpression>)

Creates an in filter for a string array field.

public FilterDefinition<TDocument> AnyStringIn(FieldDefinition<TDocument, IEnumerable<string>> field, IEnumerable<StringOrRegularExpression> values)

Parameters

field FieldDefinition<TDocument, IEnumerable<string>>

The field.

values IEnumerable<StringOrRegularExpression>

The values.

Returns

FilterDefinition<TDocument>

An in filter.

AnyStringIn(Expression<Func<TDocument, IEnumerable<string>>>, params StringOrRegularExpression[])

Creates an in filter for a string array field.

public FilterDefinition<TDocument> AnyStringIn(Expression<Func<TDocument, IEnumerable<string>>> field, params StringOrRegularExpression[] values)

Parameters

field Expression<Func<TDocument, IEnumerable<string>>>

The field.

values StringOrRegularExpression[]

The values.

Returns

FilterDefinition<TDocument>

An in filter.

AnyStringIn(Expression<Func<TDocument, IEnumerable<string>>>, IEnumerable<StringOrRegularExpression>)

Creates an in filter for a string array field.

public FilterDefinition<TDocument> AnyStringIn(Expression<Func<TDocument, IEnumerable<string>>> field, IEnumerable<StringOrRegularExpression> values)

Parameters

field Expression<Func<TDocument, IEnumerable<string>>>

The field.

values IEnumerable<StringOrRegularExpression>

The values.

Returns

FilterDefinition<TDocument>

An in filter.

AnyStringNin(FieldDefinition<TDocument, IEnumerable<string>>, params StringOrRegularExpression[])

Creates a not in filter for a string array field.

public FilterDefinition<TDocument> AnyStringNin(FieldDefinition<TDocument, IEnumerable<string>> field, params StringOrRegularExpression[] values)

Parameters

field FieldDefinition<TDocument, IEnumerable<string>>

The field.

values StringOrRegularExpression[]

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

AnyStringNin(FieldDefinition<TDocument, IEnumerable<string>>, IEnumerable<StringOrRegularExpression>)

Creates a not in filter for a string array field.

public FilterDefinition<TDocument> AnyStringNin(FieldDefinition<TDocument, IEnumerable<string>> field, IEnumerable<StringOrRegularExpression> values)

Parameters

field FieldDefinition<TDocument, IEnumerable<string>>

The field.

values IEnumerable<StringOrRegularExpression>

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

AnyStringNin(Expression<Func<TDocument, IEnumerable<string>>>, params StringOrRegularExpression[])

Creates a not in filter for a string array field.

public FilterDefinition<TDocument> AnyStringNin(Expression<Func<TDocument, IEnumerable<string>>> field, params StringOrRegularExpression[] values)

Parameters

field Expression<Func<TDocument, IEnumerable<string>>>

The field.

values StringOrRegularExpression[]

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

AnyStringNin(Expression<Func<TDocument, IEnumerable<string>>>, IEnumerable<StringOrRegularExpression>)

Creates a not in filter for a string array field.

public FilterDefinition<TDocument> AnyStringNin(Expression<Func<TDocument, IEnumerable<string>>> field, IEnumerable<StringOrRegularExpression> values)

Parameters

field Expression<Func<TDocument, IEnumerable<string>>>

The field.

values IEnumerable<StringOrRegularExpression>

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

BitsAllClear(FieldDefinition<TDocument>, long)

Creates a bits all clear filter.

public FilterDefinition<TDocument> BitsAllClear(FieldDefinition<TDocument> field, long bitmask)

Parameters

field FieldDefinition<TDocument>

The field.

bitmask long

The bitmask.

Returns

FilterDefinition<TDocument>

A bits all clear filter.

BitsAllClear(Expression<Func<TDocument, object>>, long)

Creates a bits all clear filter.

public FilterDefinition<TDocument> BitsAllClear(Expression<Func<TDocument, object>> field, long bitmask)

Parameters

field Expression<Func<TDocument, object>>

The field.

bitmask long

The bitmask.

Returns

FilterDefinition<TDocument>

A bits all clear filter.

BitsAllSet(FieldDefinition<TDocument>, long)

Creates a bits all set filter.

public FilterDefinition<TDocument> BitsAllSet(FieldDefinition<TDocument> field, long bitmask)

Parameters

field FieldDefinition<TDocument>

The field.

bitmask long

The bitmask.

Returns

FilterDefinition<TDocument>

A bits all set filter.

BitsAllSet(Expression<Func<TDocument, object>>, long)

Creates a bits all set filter.

public FilterDefinition<TDocument> BitsAllSet(Expression<Func<TDocument, object>> field, long bitmask)

Parameters

field Expression<Func<TDocument, object>>

The field.

bitmask long

The bitmask.

Returns

FilterDefinition<TDocument>

A bits all set filter.

BitsAnyClear(FieldDefinition<TDocument>, long)

Creates a bits any clear filter.

public FilterDefinition<TDocument> BitsAnyClear(FieldDefinition<TDocument> field, long bitmask)

Parameters

field FieldDefinition<TDocument>

The field.

bitmask long

The bitmask.

Returns

FilterDefinition<TDocument>

A bits any clear filter.

BitsAnyClear(Expression<Func<TDocument, object>>, long)

Creates a bits any clear filter.

public FilterDefinition<TDocument> BitsAnyClear(Expression<Func<TDocument, object>> field, long bitmask)

Parameters

field Expression<Func<TDocument, object>>

The field.

bitmask long

The bitmask.

Returns

FilterDefinition<TDocument>

A bits any clear filter.

BitsAnySet(FieldDefinition<TDocument>, long)

Creates a bits any set filter.

public FilterDefinition<TDocument> BitsAnySet(FieldDefinition<TDocument> field, long bitmask)

Parameters

field FieldDefinition<TDocument>

The field.

bitmask long

The bitmask.

Returns

FilterDefinition<TDocument>

A bits any set filter.

BitsAnySet(Expression<Func<TDocument, object>>, long)

Creates a bits any set filter.

public FilterDefinition<TDocument> BitsAnySet(Expression<Func<TDocument, object>> field, long bitmask)

Parameters

field Expression<Func<TDocument, object>>

The field.

bitmask long

The bitmask.

Returns

FilterDefinition<TDocument>

A bits any set filter.

ElemMatch<TItem>(FieldDefinition<TDocument>, FilterDefinition<TItem>)

Creates an element match filter for an array field.

public FilterDefinition<TDocument> ElemMatch<TItem>(FieldDefinition<TDocument> field, FilterDefinition<TItem> filter)

Parameters

field FieldDefinition<TDocument>

The field.

filter FilterDefinition<TItem>

The filter.

Returns

FilterDefinition<TDocument>

An element match filter.

Type Parameters

TItem

The type of the item.

ElemMatch<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, FilterDefinition<TItem>)

Creates an element match filter for an array field.

public FilterDefinition<TDocument> ElemMatch<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, FilterDefinition<TItem> filter)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

filter FilterDefinition<TItem>

The filter.

Returns

FilterDefinition<TDocument>

An element match filter.

Type Parameters

TItem

The type of the item.

ElemMatch<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>>, Expression<Func<TItem, bool>>)

Creates an element match filter for an array field.

public FilterDefinition<TDocument> ElemMatch<TItem>(Expression<Func<TDocument, IEnumerable<TItem>>> field, Expression<Func<TItem, bool>> filter)

Parameters

field Expression<Func<TDocument, IEnumerable<TItem>>>

The field.

filter Expression<Func<TItem, bool>>

The filter.

Returns

FilterDefinition<TDocument>

An element match filter.

Type Parameters

TItem

The type of the item.

Eq<TField>(FieldDefinition<TDocument, TField>, TField)

Creates an equality filter.

public FilterDefinition<TDocument> Eq<TField>(FieldDefinition<TDocument, TField> field, TField value)

Parameters

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

An equality filter.

Type Parameters

TField

The type of the field.

Eq<TField>(Expression<Func<TDocument, TField>>, TField)

Creates an equality filter.

public FilterDefinition<TDocument> Eq<TField>(Expression<Func<TDocument, TField>> field, TField value)

Parameters

field Expression<Func<TDocument, TField>>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

An equality filter.

Type Parameters

TField

The type of the field.

Exists(FieldDefinition<TDocument>, bool)

Creates an exists filter.

public FilterDefinition<TDocument> Exists(FieldDefinition<TDocument> field, bool exists = true)

Parameters

field FieldDefinition<TDocument>

The field.

exists bool

if set to true [exists].

Returns

FilterDefinition<TDocument>

An exists filter.

Exists(Expression<Func<TDocument, object>>, bool)

Creates an exists filter.

public FilterDefinition<TDocument> Exists(Expression<Func<TDocument, object>> field, bool exists = true)

Parameters

field Expression<Func<TDocument, object>>

The field.

exists bool

if set to true [exists].

Returns

FilterDefinition<TDocument>

An exists filter.

GeoIntersects<TCoordinates>(FieldDefinition<TDocument>, GeoJsonGeometry<TCoordinates>)

Creates a geo intersects filter.

public FilterDefinition<TDocument> GeoIntersects<TCoordinates>(FieldDefinition<TDocument> field, GeoJsonGeometry<TCoordinates> geometry) where TCoordinates : GeoJsonCoordinates

Parameters

field FieldDefinition<TDocument>

The field.

geometry GeoJsonGeometry<TCoordinates>

The geometry.

Returns

FilterDefinition<TDocument>

A geo intersects filter.

Type Parameters

TCoordinates

The type of the coordinates.

GeoIntersects<TCoordinates>(Expression<Func<TDocument, object>>, GeoJsonGeometry<TCoordinates>)

Creates a geo intersects filter.

public FilterDefinition<TDocument> GeoIntersects<TCoordinates>(Expression<Func<TDocument, object>> field, GeoJsonGeometry<TCoordinates> geometry) where TCoordinates : GeoJsonCoordinates

Parameters

field Expression<Func<TDocument, object>>

The field.

geometry GeoJsonGeometry<TCoordinates>

The geometry.

Returns

FilterDefinition<TDocument>

A geo intersects filter.

Type Parameters

TCoordinates

The type of the coordinates.

GeoWithinBox(FieldDefinition<TDocument>, double, double, double, double)

Creates a geo within box filter.

public FilterDefinition<TDocument> GeoWithinBox(FieldDefinition<TDocument> field, double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY)

Parameters

field FieldDefinition<TDocument>

The field.

lowerLeftX double

The lower left x.

lowerLeftY double

The lower left y.

upperRightX double

The upper right x.

upperRightY double

The upper right y.

Returns

FilterDefinition<TDocument>

A geo within box filter.

GeoWithinBox(Expression<Func<TDocument, object>>, double, double, double, double)

Creates a geo within box filter.

public FilterDefinition<TDocument> GeoWithinBox(Expression<Func<TDocument, object>> field, double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY)

Parameters

field Expression<Func<TDocument, object>>

The field.

lowerLeftX double

The lower left x.

lowerLeftY double

The lower left y.

upperRightX double

The upper right x.

upperRightY double

The upper right y.

Returns

FilterDefinition<TDocument>

A geo within box filter.

GeoWithinCenter(FieldDefinition<TDocument>, double, double, double)

Creates a geo within center filter.

public FilterDefinition<TDocument> GeoWithinCenter(FieldDefinition<TDocument> field, double x, double y, double radius)

Parameters

field FieldDefinition<TDocument>

The field.

x double

The x.

y double

The y.

radius double

The radius.

Returns

FilterDefinition<TDocument>

A geo within center filter.

GeoWithinCenter(Expression<Func<TDocument, object>>, double, double, double)

Creates a geo within center filter.

public FilterDefinition<TDocument> GeoWithinCenter(Expression<Func<TDocument, object>> field, double x, double y, double radius)

Parameters

field Expression<Func<TDocument, object>>

The field.

x double

The x.

y double

The y.

radius double

The radius.

Returns

FilterDefinition<TDocument>

A geo within center filter.

GeoWithinCenterSphere(FieldDefinition<TDocument>, double, double, double)

Creates a geo within center sphere filter.

public FilterDefinition<TDocument> GeoWithinCenterSphere(FieldDefinition<TDocument> field, double x, double y, double radius)

Parameters

field FieldDefinition<TDocument>

The field.

x double

The x.

y double

The y.

radius double

The radius.

Returns

FilterDefinition<TDocument>

A geo within center sphere filter.

GeoWithinCenterSphere(Expression<Func<TDocument, object>>, double, double, double)

Creates a geo within center sphere filter.

public FilterDefinition<TDocument> GeoWithinCenterSphere(Expression<Func<TDocument, object>> field, double x, double y, double radius)

Parameters

field Expression<Func<TDocument, object>>

The field.

x double

The x.

y double

The y.

radius double

The radius.

Returns

FilterDefinition<TDocument>

A geo within center sphere filter.

GeoWithinPolygon(FieldDefinition<TDocument>, double[,])

Creates a geo within polygon filter.

public FilterDefinition<TDocument> GeoWithinPolygon(FieldDefinition<TDocument> field, double[,] points)

Parameters

field FieldDefinition<TDocument>

The field.

points double[,]

The points.

Returns

FilterDefinition<TDocument>

A geo within polygon filter.

GeoWithinPolygon(Expression<Func<TDocument, object>>, double[,])

Creates a geo within polygon filter.

public FilterDefinition<TDocument> GeoWithinPolygon(Expression<Func<TDocument, object>> field, double[,] points)

Parameters

field Expression<Func<TDocument, object>>

The field.

points double[,]

The points.

Returns

FilterDefinition<TDocument>

A geo within polygon filter.

GeoWithin<TCoordinates>(FieldDefinition<TDocument>, GeoJsonGeometry<TCoordinates>)

Creates a geo within filter.

public FilterDefinition<TDocument> GeoWithin<TCoordinates>(FieldDefinition<TDocument> field, GeoJsonGeometry<TCoordinates> geometry) where TCoordinates : GeoJsonCoordinates

Parameters

field FieldDefinition<TDocument>

The field.

geometry GeoJsonGeometry<TCoordinates>

The geometry.

Returns

FilterDefinition<TDocument>

A geo within filter.

Type Parameters

TCoordinates

The type of the coordinates.

GeoWithin<TCoordinates>(Expression<Func<TDocument, object>>, GeoJsonGeometry<TCoordinates>)

Creates a geo within filter.

public FilterDefinition<TDocument> GeoWithin<TCoordinates>(Expression<Func<TDocument, object>> field, GeoJsonGeometry<TCoordinates> geometry) where TCoordinates : GeoJsonCoordinates

Parameters

field Expression<Func<TDocument, object>>

The field.

geometry GeoJsonGeometry<TCoordinates>

The geometry.

Returns

FilterDefinition<TDocument>

A geo within filter.

Type Parameters

TCoordinates

The type of the coordinates.

Gt(FieldDefinition<TDocument, uint>, uint)

Creates a greater than filter for a UInt32 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Gt(FieldDefinition<TDocument, uint> field, uint value)

Parameters

field FieldDefinition<TDocument, uint>

The field.

value uint

The value.

Returns

FilterDefinition<TDocument>

A greater than filter.

Gt(FieldDefinition<TDocument, ulong>, ulong)

Creates a greater than filter for a UInt64 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Gt(FieldDefinition<TDocument, ulong> field, ulong value)

Parameters

field FieldDefinition<TDocument, ulong>

The field.

value ulong

The value.

Returns

FilterDefinition<TDocument>

A greater than filter.

Gt(Expression<Func<TDocument, uint>>, uint)

Creates a greater than filter for a UInt32 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Gt(Expression<Func<TDocument, uint>> field, uint value)

Parameters

field Expression<Func<TDocument, uint>>

The field.

value uint

The value.

Returns

FilterDefinition<TDocument>

A greater than filter.

Gt(Expression<Func<TDocument, ulong>>, ulong)

Creates a greater than filter for a UInt64 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Gt(Expression<Func<TDocument, ulong>> field, ulong value)

Parameters

field Expression<Func<TDocument, ulong>>

The field.

value ulong

The value.

Returns

FilterDefinition<TDocument>

A greater than filter.

Gt<TField>(FieldDefinition<TDocument, TField>, TField)

Creates a greater than filter.

public FilterDefinition<TDocument> Gt<TField>(FieldDefinition<TDocument, TField> field, TField value)

Parameters

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A greater than filter.

Type Parameters

TField

The type of the field.

Gt<TField>(Expression<Func<TDocument, TField>>, TField)

Creates a greater than filter.

public FilterDefinition<TDocument> Gt<TField>(Expression<Func<TDocument, TField>> field, TField value)

Parameters

field Expression<Func<TDocument, TField>>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A greater than filter.

Type Parameters

TField

The type of the field.

Gte(FieldDefinition<TDocument, uint>, uint)

Creates a greater than or equal filter for a UInt32 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Gte(FieldDefinition<TDocument, uint> field, uint value)

Parameters

field FieldDefinition<TDocument, uint>

The field.

value uint

The value.

Returns

FilterDefinition<TDocument>

A greater than or equal filter.

Gte(FieldDefinition<TDocument, ulong>, ulong)

Creates a greater than or equal filter for a UInt64 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Gte(FieldDefinition<TDocument, ulong> field, ulong value)

Parameters

field FieldDefinition<TDocument, ulong>

The field.

value ulong

The value.

Returns

FilterDefinition<TDocument>

A greater than or equal filter.

Gte(Expression<Func<TDocument, uint>>, uint)

Creates a greater than or equal filter for a UInt32 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Gte(Expression<Func<TDocument, uint>> field, uint value)

Parameters

field Expression<Func<TDocument, uint>>

The field.

value uint

The value.

Returns

FilterDefinition<TDocument>

A greater than or equal filter.

Gte(Expression<Func<TDocument, ulong>>, ulong)

Creates a greater than or equal filter for a UInt64 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Gte(Expression<Func<TDocument, ulong>> field, ulong value)

Parameters

field Expression<Func<TDocument, ulong>>

The field.

value ulong

The value.

Returns

FilterDefinition<TDocument>

A greater than or equal filter.

Gte<TField>(FieldDefinition<TDocument, TField>, TField)

Creates a greater than or equal filter.

public FilterDefinition<TDocument> Gte<TField>(FieldDefinition<TDocument, TField> field, TField value)

Parameters

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A greater than or equal filter.

Type Parameters

TField

The type of the field.

Gte<TField>(Expression<Func<TDocument, TField>>, TField)

Creates a greater than or equal filter.

public FilterDefinition<TDocument> Gte<TField>(Expression<Func<TDocument, TField>> field, TField value)

Parameters

field Expression<Func<TDocument, TField>>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A greater than or equal filter.

Type Parameters

TField

The type of the field.

In<TField>(FieldDefinition<TDocument, TField>, IEnumerable<TField>)

Creates an in filter.

public FilterDefinition<TDocument> In<TField>(FieldDefinition<TDocument, TField> field, IEnumerable<TField> values)

Parameters

field FieldDefinition<TDocument, TField>

The field.

values IEnumerable<TField>

The values.

Returns

FilterDefinition<TDocument>

An in filter.

Type Parameters

TField

The type of the field.

In<TField>(Expression<Func<TDocument, TField>>, IEnumerable<TField>)

Creates an in filter.

public FilterDefinition<TDocument> In<TField>(Expression<Func<TDocument, TField>> field, IEnumerable<TField> values)

Parameters

field Expression<Func<TDocument, TField>>

The field.

values IEnumerable<TField>

The values.

Returns

FilterDefinition<TDocument>

An in filter.

Type Parameters

TField

The type of the field.

JsonSchema(BsonDocument)

Creates a json schema filter.

public FilterDefinition<TDocument> JsonSchema(BsonDocument schema)

Parameters

schema BsonDocument

The json validation schema.

Returns

FilterDefinition<TDocument>

A schema filter.

Lt(FieldDefinition<TDocument, uint>, uint)

Creates a less than filter for a UInt32 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Lt(FieldDefinition<TDocument, uint> field, uint value)

Parameters

field FieldDefinition<TDocument, uint>

The field.

value uint

The value.

Returns

FilterDefinition<TDocument>

A less than filter.

Lt(FieldDefinition<TDocument, ulong>, ulong)

Creates a less than filter for a UInt64 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Lt(FieldDefinition<TDocument, ulong> field, ulong value)

Parameters

field FieldDefinition<TDocument, ulong>

The field.

value ulong

The value.

Returns

FilterDefinition<TDocument>

A less than filter.

Lt(Expression<Func<TDocument, uint>>, uint)

Creates a less than filter for a UInt32 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Lt(Expression<Func<TDocument, uint>> field, uint value)

Parameters

field Expression<Func<TDocument, uint>>

The field.

value uint

The value.

Returns

FilterDefinition<TDocument>

A less than filter.

Lt(Expression<Func<TDocument, ulong>>, ulong)

Creates a less than filter for a UInt64 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Lt(Expression<Func<TDocument, ulong>> field, ulong value)

Parameters

field Expression<Func<TDocument, ulong>>

The field.

value ulong

The value.

Returns

FilterDefinition<TDocument>

A less than filter.

Lt<TField>(FieldDefinition<TDocument, TField>, TField)

Creates a less than filter.

public FilterDefinition<TDocument> Lt<TField>(FieldDefinition<TDocument, TField> field, TField value)

Parameters

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A less than filter.

Type Parameters

TField

The type of the field.

Lt<TField>(Expression<Func<TDocument, TField>>, TField)

Creates a less than filter.

public FilterDefinition<TDocument> Lt<TField>(Expression<Func<TDocument, TField>> field, TField value)

Parameters

field Expression<Func<TDocument, TField>>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A less than filter.

Type Parameters

TField

The type of the field.

Lte(FieldDefinition<TDocument, uint>, uint)

Creates a less than or equal filter for a UInt32 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Lte(FieldDefinition<TDocument, uint> field, uint value)

Parameters

field FieldDefinition<TDocument, uint>

The field.

value uint

The value.

Returns

FilterDefinition<TDocument>

A less than or equal filter.

Lte(FieldDefinition<TDocument, ulong>, ulong)

Creates a less than or equal filter for a UInt64 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Lte(FieldDefinition<TDocument, ulong> field, ulong value)

Parameters

field FieldDefinition<TDocument, ulong>

The field.

value ulong

The value.

Returns

FilterDefinition<TDocument>

A less than or equal filter.

Lte(Expression<Func<TDocument, uint>>, uint)

Creates a less than or equal filter for a UInt32 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Lte(Expression<Func<TDocument, uint>> field, uint value)

Parameters

field Expression<Func<TDocument, uint>>

The field.

value uint

The value.

Returns

FilterDefinition<TDocument>

A less than or equal filter.

Lte(Expression<Func<TDocument, ulong>>, ulong)

Creates a less than or equal filter for a UInt64 field.

[CLSCompliant(false)]
public FilterDefinition<TDocument> Lte(Expression<Func<TDocument, ulong>> field, ulong value)

Parameters

field Expression<Func<TDocument, ulong>>

The field.

value ulong

The value.

Returns

FilterDefinition<TDocument>

A less than or equal filter.

Lte<TField>(FieldDefinition<TDocument, TField>, TField)

Creates a less than or equal filter.

public FilterDefinition<TDocument> Lte<TField>(FieldDefinition<TDocument, TField> field, TField value)

Parameters

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A less than or equal filter.

Type Parameters

TField

The type of the field.

Lte<TField>(Expression<Func<TDocument, TField>>, TField)

Creates a less than or equal filter.

public FilterDefinition<TDocument> Lte<TField>(Expression<Func<TDocument, TField>> field, TField value)

Parameters

field Expression<Func<TDocument, TField>>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A less than or equal filter.

Type Parameters

TField

The type of the field.

Mod(FieldDefinition<TDocument>, long, long)

Creates a modulo filter.

public FilterDefinition<TDocument> Mod(FieldDefinition<TDocument> field, long modulus, long remainder)

Parameters

field FieldDefinition<TDocument>

The field.

modulus long

The modulus.

remainder long

The remainder.

Returns

FilterDefinition<TDocument>

A modulo filter.

Mod(Expression<Func<TDocument, object>>, long, long)

Creates a modulo filter.

public FilterDefinition<TDocument> Mod(Expression<Func<TDocument, object>> field, long modulus, long remainder)

Parameters

field Expression<Func<TDocument, object>>

The field.

modulus long

The modulus.

remainder long

The remainder.

Returns

FilterDefinition<TDocument>

A modulo filter.

Ne<TField>(FieldDefinition<TDocument, TField>, TField)

Creates a not equal filter.

public FilterDefinition<TDocument> Ne<TField>(FieldDefinition<TDocument, TField> field, TField value)

Parameters

field FieldDefinition<TDocument, TField>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A not equal filter.

Type Parameters

TField

The type of the field.

Ne<TField>(Expression<Func<TDocument, TField>>, TField)

Creates a not equal filter.

public FilterDefinition<TDocument> Ne<TField>(Expression<Func<TDocument, TField>> field, TField value)

Parameters

field Expression<Func<TDocument, TField>>

The field.

value TField

The value.

Returns

FilterDefinition<TDocument>

A not equal filter.

Type Parameters

TField

The type of the field.

Near(FieldDefinition<TDocument>, double, double, double?, double?)

Creates a near filter.

public FilterDefinition<TDocument> Near(FieldDefinition<TDocument> field, double x, double y, double? maxDistance = null, double? minDistance = null)

Parameters

field FieldDefinition<TDocument>

The field.

x double

The x.

y double

The y.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near filter.

Near(Expression<Func<TDocument, object>>, double, double, double?, double?)

Creates a near filter.

public FilterDefinition<TDocument> Near(Expression<Func<TDocument, object>> field, double x, double y, double? maxDistance = null, double? minDistance = null)

Parameters

field Expression<Func<TDocument, object>>

The field.

x double

The x.

y double

The y.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near filter.

NearSphere(FieldDefinition<TDocument>, double, double, double?, double?)

Creates a near sphere filter.

public FilterDefinition<TDocument> NearSphere(FieldDefinition<TDocument> field, double x, double y, double? maxDistance = null, double? minDistance = null)

Parameters

field FieldDefinition<TDocument>

The field.

x double

The x.

y double

The y.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near sphere filter.

NearSphere(Expression<Func<TDocument, object>>, double, double, double?, double?)

Creates a near sphere filter.

public FilterDefinition<TDocument> NearSphere(Expression<Func<TDocument, object>> field, double x, double y, double? maxDistance = null, double? minDistance = null)

Parameters

field Expression<Func<TDocument, object>>

The field.

x double

The x.

y double

The y.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near sphere filter.

NearSphere<TCoordinates>(FieldDefinition<TDocument>, GeoJsonPoint<TCoordinates>, double?, double?)

Creates a near sphere filter.

public FilterDefinition<TDocument> NearSphere<TCoordinates>(FieldDefinition<TDocument> field, GeoJsonPoint<TCoordinates> point, double? maxDistance = null, double? minDistance = null) where TCoordinates : GeoJsonCoordinates

Parameters

field FieldDefinition<TDocument>

The field.

point GeoJsonPoint<TCoordinates>

The geometry.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near sphere filter.

Type Parameters

TCoordinates

The type of the coordinates.

NearSphere<TCoordinates>(Expression<Func<TDocument, object>>, GeoJsonPoint<TCoordinates>, double?, double?)

Creates a near sphere filter.

public FilterDefinition<TDocument> NearSphere<TCoordinates>(Expression<Func<TDocument, object>> field, GeoJsonPoint<TCoordinates> point, double? maxDistance = null, double? minDistance = null) where TCoordinates : GeoJsonCoordinates

Parameters

field Expression<Func<TDocument, object>>

The field.

point GeoJsonPoint<TCoordinates>

The geometry.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near sphere filter.

Type Parameters

TCoordinates

The type of the coordinates.

Near<TCoordinates>(FieldDefinition<TDocument>, GeoJsonPoint<TCoordinates>, double?, double?)

Creates a near filter.

public FilterDefinition<TDocument> Near<TCoordinates>(FieldDefinition<TDocument> field, GeoJsonPoint<TCoordinates> point, double? maxDistance = null, double? minDistance = null) where TCoordinates : GeoJsonCoordinates

Parameters

field FieldDefinition<TDocument>

The field.

point GeoJsonPoint<TCoordinates>

The geometry.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near filter.

Type Parameters

TCoordinates

The type of the coordinates.

Near<TCoordinates>(Expression<Func<TDocument, object>>, GeoJsonPoint<TCoordinates>, double?, double?)

Creates a near filter.

public FilterDefinition<TDocument> Near<TCoordinates>(Expression<Func<TDocument, object>> field, GeoJsonPoint<TCoordinates> point, double? maxDistance = null, double? minDistance = null) where TCoordinates : GeoJsonCoordinates

Parameters

field Expression<Func<TDocument, object>>

The field.

point GeoJsonPoint<TCoordinates>

The geometry.

maxDistance double?

The maximum distance.

minDistance double?

The minimum distance.

Returns

FilterDefinition<TDocument>

A near filter.

Type Parameters

TCoordinates

The type of the coordinates.

Nin<TField>(FieldDefinition<TDocument, TField>, IEnumerable<TField>)

Creates a not in filter.

public FilterDefinition<TDocument> Nin<TField>(FieldDefinition<TDocument, TField> field, IEnumerable<TField> values)

Parameters

field FieldDefinition<TDocument, TField>

The field.

values IEnumerable<TField>

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

Type Parameters

TField

The type of the field.

Nin<TField>(Expression<Func<TDocument, TField>>, IEnumerable<TField>)

Creates a not in filter.

public FilterDefinition<TDocument> Nin<TField>(Expression<Func<TDocument, TField>> field, IEnumerable<TField> values)

Parameters

field Expression<Func<TDocument, TField>>

The field.

values IEnumerable<TField>

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

Type Parameters

TField

The type of the field.

Not(FilterDefinition<TDocument>)

Creates a not filter.

public FilterDefinition<TDocument> Not(FilterDefinition<TDocument> filter)

Parameters

filter FilterDefinition<TDocument>

The filter.

Returns

FilterDefinition<TDocument>

A not filter.

OfType<TDerived>()

Creates an OfType filter that matches documents of a derived type.

public FilterDefinition<TDocument> OfType<TDerived>() where TDerived : TDocument

Returns

FilterDefinition<TDocument>

An OfType filter.

Type Parameters

TDerived

The type of the matching derived documents.

OfType<TDerived>(FilterDefinition<TDerived>)

Creates an OfType filter that matches documents of a derived type and that also match a filter on the derived document.

public FilterDefinition<TDocument> OfType<TDerived>(FilterDefinition<TDerived> derivedDocumentFilter) where TDerived : TDocument

Parameters

derivedDocumentFilter FilterDefinition<TDerived>

A filter on the derived document.

Returns

FilterDefinition<TDocument>

An OfType filter.

Type Parameters

TDerived

The type of the matching derived documents.

OfType<TDerived>(Expression<Func<TDerived, bool>>)

Creates an OfType filter that matches documents of a derived type and that also match a filter on the derived document.

public FilterDefinition<TDocument> OfType<TDerived>(Expression<Func<TDerived, bool>> derivedDocumentFilter) where TDerived : TDocument

Parameters

derivedDocumentFilter Expression<Func<TDerived, bool>>

A filter on the derived document.

Returns

FilterDefinition<TDocument>

An OfType filter.

Type Parameters

TDerived

The type of the matching derived documents.

OfType<TField, TDerived>(FieldDefinition<TDocument, TField>)

Creates an OfType filter that matches documents with a field of a derived typer.

public FilterDefinition<TDocument> OfType<TField, TDerived>(FieldDefinition<TDocument, TField> field) where TDerived : TField

Parameters

field FieldDefinition<TDocument, TField>

The field.

Returns

FilterDefinition<TDocument>

An OfType filter.

Type Parameters

TField

The type of the field.

TDerived

The type of the matching derived field value.

OfType<TField, TDerived>(FieldDefinition<TDocument, TField>, FilterDefinition<TDerived>)

Creates an OfType filter that matches documents with a field of a derived type and that also match a filter on the derived field.

public FilterDefinition<TDocument> OfType<TField, TDerived>(FieldDefinition<TDocument, TField> field, FilterDefinition<TDerived> derivedFieldFilter) where TDerived : TField

Parameters

field FieldDefinition<TDocument, TField>

The field.

derivedFieldFilter FilterDefinition<TDerived>

A filter on the derived field.

Returns

FilterDefinition<TDocument>

An OfType filter.

Type Parameters

TField

The type of the field.

TDerived

The type of the matching derived field value.

OfType<TField, TDerived>(Expression<Func<TDocument, TField>>)

Creates an OfType filter that matches documents with a field of a derived type.

public FilterDefinition<TDocument> OfType<TField, TDerived>(Expression<Func<TDocument, TField>> field) where TDerived : TField

Parameters

field Expression<Func<TDocument, TField>>

The field.

Returns

FilterDefinition<TDocument>

An OfType filter.

Type Parameters

TField

The type of the field.

TDerived

The type of the matching derived field value.

OfType<TField, TDerived>(Expression<Func<TDocument, TField>>, Expression<Func<TDerived, bool>>)

Creates an OfType filter that matches documents with a field of a derived type and that also match a filter on the derived field.

public FilterDefinition<TDocument> OfType<TField, TDerived>(Expression<Func<TDocument, TField>> field, Expression<Func<TDerived, bool>> derivedFieldFilter) where TDerived : TField

Parameters

field Expression<Func<TDocument, TField>>

The field.

derivedFieldFilter Expression<Func<TDerived, bool>>

A filter on the derived field.

Returns

FilterDefinition<TDocument>

An OfType filter.

Type Parameters

TField

The type of the field.

TDerived

The type of the matching derived field value.

Or(params FilterDefinition<TDocument>[])

Creates an or filter.

public FilterDefinition<TDocument> Or(params FilterDefinition<TDocument>[] filters)

Parameters

filters FilterDefinition<TDocument>[]

The filters.

Returns

FilterDefinition<TDocument>

An or filter.

Or(IEnumerable<FilterDefinition<TDocument>>)

Creates an or filter.

public FilterDefinition<TDocument> Or(IEnumerable<FilterDefinition<TDocument>> filters)

Parameters

filters IEnumerable<FilterDefinition<TDocument>>

The filters.

Returns

FilterDefinition<TDocument>

An or filter.

Regex(FieldDefinition<TDocument>, BsonRegularExpression)

Creates a regular expression filter.

public FilterDefinition<TDocument> Regex(FieldDefinition<TDocument> field, BsonRegularExpression regex)

Parameters

field FieldDefinition<TDocument>

The field.

regex BsonRegularExpression

The regex.

Returns

FilterDefinition<TDocument>

A regular expression filter.

Regex(Expression<Func<TDocument, object>>, BsonRegularExpression)

Creates a regular expression filter.

public FilterDefinition<TDocument> Regex(Expression<Func<TDocument, object>> field, BsonRegularExpression regex)

Parameters

field Expression<Func<TDocument, object>>

The field.

regex BsonRegularExpression

The regex.

Returns

FilterDefinition<TDocument>

A regular expression filter.

Size(FieldDefinition<TDocument>, int)

Creates a size filter.

public FilterDefinition<TDocument> Size(FieldDefinition<TDocument> field, int size)

Parameters

field FieldDefinition<TDocument>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size filter.

Size(Expression<Func<TDocument, object>>, int)

Creates a size filter.

public FilterDefinition<TDocument> Size(Expression<Func<TDocument, object>> field, int size)

Parameters

field Expression<Func<TDocument, object>>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size filter.

SizeGt(FieldDefinition<TDocument>, int)

Creates a size greater than filter.

public FilterDefinition<TDocument> SizeGt(FieldDefinition<TDocument> field, int size)

Parameters

field FieldDefinition<TDocument>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size greater than filter.

SizeGt(Expression<Func<TDocument, object>>, int)

Creates a size greater than filter.

public FilterDefinition<TDocument> SizeGt(Expression<Func<TDocument, object>> field, int size)

Parameters

field Expression<Func<TDocument, object>>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size greater than filter.

SizeGte(FieldDefinition<TDocument>, int)

Creates a size greater than or equal filter.

public FilterDefinition<TDocument> SizeGte(FieldDefinition<TDocument> field, int size)

Parameters

field FieldDefinition<TDocument>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size greater than or equal filter.

SizeGte(Expression<Func<TDocument, object>>, int)

Creates a size greater than or equal filter.

public FilterDefinition<TDocument> SizeGte(Expression<Func<TDocument, object>> field, int size)

Parameters

field Expression<Func<TDocument, object>>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size greater than or equal filter.

SizeLt(FieldDefinition<TDocument>, int)

Creates a size less than filter.

public FilterDefinition<TDocument> SizeLt(FieldDefinition<TDocument> field, int size)

Parameters

field FieldDefinition<TDocument>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size less than filter.

SizeLt(Expression<Func<TDocument, object>>, int)

Creates a size less than filter.

public FilterDefinition<TDocument> SizeLt(Expression<Func<TDocument, object>> field, int size)

Parameters

field Expression<Func<TDocument, object>>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size less than filter.

SizeLte(FieldDefinition<TDocument>, int)

Creates a size less than or equal filter.

public FilterDefinition<TDocument> SizeLte(FieldDefinition<TDocument> field, int size)

Parameters

field FieldDefinition<TDocument>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size less than or equal filter.

SizeLte(Expression<Func<TDocument, object>>, int)

Creates a size less than or equal filter.

public FilterDefinition<TDocument> SizeLte(Expression<Func<TDocument, object>> field, int size)

Parameters

field Expression<Func<TDocument, object>>

The field.

size int

The size.

Returns

FilterDefinition<TDocument>

A size less than or equal filter.

StringIn(FieldDefinition<TDocument, string>, params StringOrRegularExpression[])

Creates an in filter for a string field.

public FilterDefinition<TDocument> StringIn(FieldDefinition<TDocument, string> field, params StringOrRegularExpression[] values)

Parameters

field FieldDefinition<TDocument, string>

The field.

values StringOrRegularExpression[]

The values.

Returns

FilterDefinition<TDocument>

An in filter.

StringIn(FieldDefinition<TDocument, string>, IEnumerable<StringOrRegularExpression>)

Creates an in filter for a string field.

public FilterDefinition<TDocument> StringIn(FieldDefinition<TDocument, string> field, IEnumerable<StringOrRegularExpression> values)

Parameters

field FieldDefinition<TDocument, string>

The field.

values IEnumerable<StringOrRegularExpression>

The values.

Returns

FilterDefinition<TDocument>

An in filter.

StringIn(Expression<Func<TDocument, string>>, params StringOrRegularExpression[])

Creates an in filter for a string field.

public FilterDefinition<TDocument> StringIn(Expression<Func<TDocument, string>> field, params StringOrRegularExpression[] values)

Parameters

field Expression<Func<TDocument, string>>

The field.

values StringOrRegularExpression[]

The values.

Returns

FilterDefinition<TDocument>

An in filter.

StringIn(Expression<Func<TDocument, string>>, IEnumerable<StringOrRegularExpression>)

Creates an in filter for a string field.

public FilterDefinition<TDocument> StringIn(Expression<Func<TDocument, string>> field, IEnumerable<StringOrRegularExpression> values)

Parameters

field Expression<Func<TDocument, string>>

The field.

values IEnumerable<StringOrRegularExpression>

The values.

Returns

FilterDefinition<TDocument>

An in filter.

StringNin(FieldDefinition<TDocument, string>, params StringOrRegularExpression[])

Creates a not in filter for a string field.

public FilterDefinition<TDocument> StringNin(FieldDefinition<TDocument, string> field, params StringOrRegularExpression[] values)

Parameters

field FieldDefinition<TDocument, string>

The field.

values StringOrRegularExpression[]

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

StringNin(FieldDefinition<TDocument, string>, IEnumerable<StringOrRegularExpression>)

Creates a not in filter for a string field.

public FilterDefinition<TDocument> StringNin(FieldDefinition<TDocument, string> field, IEnumerable<StringOrRegularExpression> values)

Parameters

field FieldDefinition<TDocument, string>

The field.

values IEnumerable<StringOrRegularExpression>

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

StringNin(Expression<Func<TDocument, string>>, params StringOrRegularExpression[])

Creates a not in filter for a string field.

public FilterDefinition<TDocument> StringNin(Expression<Func<TDocument, string>> field, params StringOrRegularExpression[] values)

Parameters

field Expression<Func<TDocument, string>>

The field.

values StringOrRegularExpression[]

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

StringNin(Expression<Func<TDocument, string>>, IEnumerable<StringOrRegularExpression>)

Creates a not in filter for a string field.

public FilterDefinition<TDocument> StringNin(Expression<Func<TDocument, string>> field, IEnumerable<StringOrRegularExpression> values)

Parameters

field Expression<Func<TDocument, string>>

The field.

values IEnumerable<StringOrRegularExpression>

The values.

Returns

FilterDefinition<TDocument>

A not in filter.

Text(string, TextSearchOptions)

Creates a text filter.

public FilterDefinition<TDocument> Text(string search, TextSearchOptions options = null)

Parameters

search string

The search.

options TextSearchOptions

The text search options.

Returns

FilterDefinition<TDocument>

A text filter.

Text(string, string)

Creates a text filter.

public FilterDefinition<TDocument> Text(string search, string language)

Parameters

search string

The search.

language string

The language.

Returns

FilterDefinition<TDocument>

A text filter.

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.

Where(Expression<Func<TDocument, bool>>)

Creates a filter based on the expression.

public FilterDefinition<TDocument> Where(Expression<Func<TDocument, bool>> expression)

Parameters

expression Expression<Func<TDocument, bool>>

The expression.

Returns

FilterDefinition<TDocument>

An expression filter.