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.

Methods

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

Creates an all filter for an array field.

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

Creates an all filter for an array field.

And(params FilterDefinition<TDocument>[])

Creates an and filter.

And(IEnumerable<FilterDefinition<TDocument>>)

Creates an and filter.

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

Creates an equality filter for an array field.

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

Creates an equality filter for an array field.

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

Creates a greater than filter for an array field.

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

Creates a greater than filter for an array field.

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

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

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

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

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

Creates an in filter for an array field.

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

Creates an in filter for an array field.

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

Creates a less than filter for an array field.

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

Creates a less than filter for an array field.

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

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

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

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

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

Creates a not equal filter for an array field.

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

Creates a not equal filter for an array field.

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

Creates a not in filter for an array field.

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

Creates a not in filter for an array field.

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

Creates an in filter for a string array field.

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

Creates an in filter for a string array field.

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

Creates an in filter for a string array field.

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

Creates an in filter for a string array field.

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

Creates a not in filter for a string array field.

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

Creates a not in filter for a string array field.

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

Creates a not in filter for a string array field.

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

Creates a not in filter for a string array field.

BitsAllClear(FieldDefinition<TDocument>, long)

Creates a bits all clear filter.

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

Creates a bits all clear filter.

BitsAllSet(FieldDefinition<TDocument>, long)

Creates a bits all set filter.

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

Creates a bits all set filter.

BitsAnyClear(FieldDefinition<TDocument>, long)

Creates a bits any clear filter.

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

Creates a bits any clear filter.

BitsAnySet(FieldDefinition<TDocument>, long)

Creates a bits any set filter.

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

Creates a bits any set filter.

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

Creates an element match filter for an array field.

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

Creates an element match filter for an array field.

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

Creates an element match filter for an array field.

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

Creates an equality filter.

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

Creates an equality filter.

Exists(FieldDefinition<TDocument>, bool)

Creates an exists filter.

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

Creates an exists filter.

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

Creates a geo intersects filter.

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

Creates a geo intersects filter.

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

Creates a geo within box filter.

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

Creates a geo within box filter.

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

Creates a geo within center filter.

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

Creates a geo within center filter.

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

Creates a geo within center sphere filter.

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

Creates a geo within center sphere filter.

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

Creates a geo within polygon filter.

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

Creates a geo within polygon filter.

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

Creates a geo within filter.

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

Creates a geo within filter.

Gt(FieldDefinition<TDocument, uint>, uint)

Creates a greater than filter for a UInt32 field.

Gt(FieldDefinition<TDocument, ulong>, ulong)

Creates a greater than filter for a UInt64 field.

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

Creates a greater than filter for a UInt32 field.

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

Creates a greater than filter for a UInt64 field.

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

Creates a greater than filter.

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

Creates a greater than filter.

Gte(FieldDefinition<TDocument, uint>, uint)

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

Gte(FieldDefinition<TDocument, ulong>, ulong)

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

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

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

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

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

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

Creates a greater than or equal filter.

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

Creates a greater than or equal filter.

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

Creates an in filter.

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

Creates an in filter.

JsonSchema(BsonDocument)

Creates a json schema filter.

Lt(FieldDefinition<TDocument, uint>, uint)

Creates a less than filter for a UInt32 field.

Lt(FieldDefinition<TDocument, ulong>, ulong)

Creates a less than filter for a UInt64 field.

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

Creates a less than filter for a UInt32 field.

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

Creates a less than filter for a UInt64 field.

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

Creates a less than filter.

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

Creates a less than filter.

Lte(FieldDefinition<TDocument, uint>, uint)

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

Lte(FieldDefinition<TDocument, ulong>, ulong)

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

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

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

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

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

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

Creates a less than or equal filter.

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

Creates a less than or equal filter.

Mod(FieldDefinition<TDocument>, long, long)

Creates a modulo filter.

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

Creates a modulo filter.

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

Creates a not equal filter.

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

Creates a not equal filter.

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

Creates a near filter.

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

Creates a near filter.

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

Creates a near sphere filter.

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

Creates a near sphere filter.

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

Creates a near sphere filter.

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

Creates a near sphere filter.

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

Creates a near filter.

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

Creates a near filter.

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

Creates a not in filter.

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

Creates a not in filter.

Not(FilterDefinition<TDocument>)

Creates a not filter.

OfType<TDerived>()

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

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.

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.

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

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

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.

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

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

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.

Or(params FilterDefinition<TDocument>[])

Creates an or filter.

Or(IEnumerable<FilterDefinition<TDocument>>)

Creates an or filter.

Regex(FieldDefinition<TDocument>, BsonRegularExpression)

Creates a regular expression filter.

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

Creates a regular expression filter.

Size(FieldDefinition<TDocument>, int)

Creates a size filter.

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

Creates a size filter.

SizeGt(FieldDefinition<TDocument>, int)

Creates a size greater than filter.

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

Creates a size greater than filter.

SizeGte(FieldDefinition<TDocument>, int)

Creates a size greater than or equal filter.

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

Creates a size greater than or equal filter.

SizeLt(FieldDefinition<TDocument>, int)

Creates a size less than filter.

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

Creates a size less than filter.

SizeLte(FieldDefinition<TDocument>, int)

Creates a size less than or equal filter.

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

Creates a size less than or equal filter.

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

Creates an in filter for a string field.

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

Creates an in filter for a string field.

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

Creates an in filter for a string field.

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

Creates an in filter for a string field.

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

Creates a not in filter for a string field.

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

Creates a not in filter for a string field.

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

Creates a not in filter for a string field.

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

Creates a not in filter for a string field.

Text(string, TextSearchOptions)

Creates a text filter.

Text(string, string)

Creates a text filter.

Type(FieldDefinition<TDocument>, BsonType)

Creates a type filter.

Type(FieldDefinition<TDocument>, string)

Creates a type filter.

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

Creates a type filter.

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

Creates a type filter.

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

Creates a filter based on the expression.