Table of Contents

Class Query<TDocument>

Namespace
MongoDB.Driver.Builders
Assembly
MongoDB.Driver.Legacy.dll

Aids in building mongo queries based on type information.

public static class Query<TDocument>

Type Parameters

TDocument

The type of the document.

Inheritance
Query<TDocument>
Inherited Members

Methods

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

Tests that the named array element contains all of the values (see $all).

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

Tests that the value of the named element has all of the specified bits clear.

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

Tests that the value of the named element has all of the specified bits set.

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

Tests that the value of the named element has any of the specified bits clear.

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

Tests that the value of the named element has any of the specified bits set.

EQ<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, TValue)

Tests that any of the values in the named array element is equal to some value.

EQ<TMember>(Expression<Func<TDocument, TMember>>, TMember)

Tests that the value of the named element is equal to some value.

ElemMatch<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, Func<QueryBuilder<TValue>, IMongoQuery>)

Tests that at least one item of the named array element matches a query (see $elemMatch).

Exists<TMember>(Expression<Func<TDocument, TMember>>)

Tests that an element of that name does or does not exist (see $exists).

GTE<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, TValue)

Tests that any of the values in the named array element is greater than or equal to some value (see $gte).

GTE<TMember>(Expression<Func<TDocument, TMember>>, TMember)

Tests that the value of the named element is greater than or equal to some value (see $gte).

GT<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, TValue)

Tests that any of the values in the named array element is greater than some value (see $lt).

GT<TMember>(Expression<Func<TDocument, TMember>>, TMember)

Tests that the value of the named element is greater than some value (see $gt).

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

Tests that a location element specified by name intersects with the geometry (see $geoIntersects).

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

Tests that any of the values in the named array element are equal to one of a list of values (see $in).

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

Tests that the value of the named element is equal to one of a list of values (see $in).

LTE<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, TValue)

Tests that any of the values in the named array element is less than or equal to some value (see $lte).

LTE<TMember>(Expression<Func<TDocument, TMember>>, TMember)

Tests that the value of the named element is less than or equal to some value (see $lte).

LT<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, TValue)

Tests that any of the values in the named array element is less than some value (see $lt).

LT<TMember>(Expression<Func<TDocument, TMember>>, TMember)

Tests that the value of the named element is less than some value (see $lt).

Matches(Expression<Func<TDocument, IEnumerable<string>>>, BsonRegularExpression)

Tests that any of the values in the named array element matches a regular expression (see $regex).

Matches(Expression<Func<TDocument, string>>, BsonRegularExpression)

Tests that the value of the named element matches a regular expression (see $regex).

Mod(Expression<Func<TDocument, IEnumerable<int>>>, long, long)

Tests that the any of the values in the named array element match some value (see $mod).

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

Tests that the modulus of the value of the named element matches some value (see $mod).

NE<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, TValue)

Tests that none of the values in the named array element is equal to some value (see $ne).

NE<TMember>(Expression<Func<TDocument, TMember>>, TMember)

Tests that an element does not equal the value (see $ne).

Near<TMember>(Expression<Func<TDocument, TMember>>, double, double)

Tests that the value of the named element is near some location (see $near).

Near<TMember>(Expression<Func<TDocument, TMember>>, double, double, double)

Tests that the value of the named element is near some location (see $near).

Near<TMember>(Expression<Func<TDocument, TMember>>, double, double, double, bool)

Tests that the value of the named element is near some location (see $near).

Near<TMember, TCoordinates>(Expression<Func<TDocument, TMember>>, GeoJsonPoint<TCoordinates>)

Tests that the value of the named element is near a point (see $near).

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

Tests that the value of the named element is near some location (see $near).

Near<TMember, TCoordinates>(Expression<Func<TDocument, TMember>>, GeoJsonPoint<TCoordinates>, double, bool)

Tests that the value of the named element is near some location (see $near).

NotExists<TMember>(Expression<Func<TDocument, TMember>>)

Tests that an element of that name does not exist (see $exists).

NotIn<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, IEnumerable<TValue>)

Tests that the none of the values of the named array element is equal to any item in a list of values (see $nin).

NotIn<TMember>(Expression<Func<TDocument, TMember>>, IEnumerable<TMember>)

Tests that the value of the named element is not equal to any item in a list of values (see $nin).

Size<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, int)

Tests that the size of the named array is equal to some value (see $size).

Type<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, BsonType)

Tests that any of the values in the named array element is equal to some type (see $type).

Type<TValue>(Expression<Func<TDocument, IEnumerable<TValue>>>, string)

Tests that any of the values in the named array element is equal to some type (see $type).

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

Tests that the type of the named element is equal to some type (see $type).

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

Tests that the type of the named element is equal to some type (see $type).

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

Builds a query from an expression.

WithinCircle<TMember>(Expression<Func<TDocument, TMember>>, double, double, double)

Tests that the value of the named element is within a circle (see $within and $center).

WithinCircle<TMember>(Expression<Func<TDocument, TMember>>, double, double, double, bool)

Tests that the value of the named element is within a circle (see $within and $center).

WithinPolygon<TMember>(Expression<Func<TDocument, TMember>>, double[,])

Tests that the value of the named element is within a polygon (see $within and $polygon).

WithinRectangle<TMember>(Expression<Func<TDocument, TMember>>, double, double, double, double)

Tests that the value of the named element is within a rectangle (see $within and $box).

Within<TMember, TCoordinates>(Expression<Func<TDocument, TMember>>, GeoJsonPolygon<TCoordinates>)

Tests that the value of the named element is within the specified geometry (see $within).