Table of Contents

Class Query

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

A builder for creating queries.

public static class Query
Inheritance
Query
Inherited Members

Properties

Empty

Gets an empty query.

Null

Gets a null value with a type of IMongoQuery.

Methods

All(string, IEnumerable<BsonValue>)

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

And(params IMongoQuery[])

Tests that all the queries are true (see $and in newer versions of the server).

And(IEnumerable<IMongoQuery>)

Tests that all the queries are true (see $and in newer versions of the server).

BitsAllClear(string, long)

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

BitsAllSet(string, long)

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

BitsAnyClear(string, long)

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

BitsAnySet(string, long)

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

Create(BsonDocument)

Creates a query manually.

Create(string, BsonValue)

Creates a query manually.

EQ(string, BsonValue)

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

ElemMatch(string, IMongoQuery)

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

Exists(string)

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

GT(string, BsonValue)

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

GTE(string, BsonValue)

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

GeoIntersects<TCoordinates>(string, GeoJsonGeometry<TCoordinates>)

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

In(string, IEnumerable<BsonValue>)

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

LT(string, BsonValue)

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

LTE(string, BsonValue)

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

Matches(string, BsonRegularExpression)

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

Mod(string, long, long)

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

NE(string, BsonValue)

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

Near(string, double, double)

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

Near(string, double, double, double)

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

Near(string, double, double, double, bool)

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

Near<TCoordinates>(string, GeoJsonPoint<TCoordinates>)

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

Near<TCoordinates>(string, GeoJsonPoint<TCoordinates>, double)

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

Near<TCoordinates>(string, GeoJsonPoint<TCoordinates>, double, bool)

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

Not(IMongoQuery)

Tests that the inverse of the query is true (see $not).

NotExists(string)

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

NotIn(string, IEnumerable<BsonValue>)

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

Or(params IMongoQuery[])

Tests that at least one of the subqueries is true (see $or).

Or(IEnumerable<IMongoQuery>)

Tests that at least one of the subqueries is true (see $or).

Size(string, int)

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

SizeGreaterThan(string, int)

Tests that the size of the named array is greater than some value.

SizeGreaterThanOrEqual(string, int)

Tests that the size of the named array is greater than or equal to some value.

SizeLessThan(string, int)

Tests that the size of the named array is less than some value.

SizeLessThanOrEqual(string, int)

Tests that the size of the named array is less than or equal to some value.

Text(string)

Generate a text search query that tests whether the given search string is present.

Text(string, TextSearchOptions)

Generate a text search query that tests whether the given search string is present using the specified language's rules. Specifies use of language appropriate stop words, stemming rules etc.

Text(string, string)

Generate a text search query that tests whether the given search string is present using the specified language's rules. Specifies use of language appropriate stop words, stemming rules etc.

Type(string, BsonType)

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

Type(string, string)

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

Where(BsonJavaScript)

Tests that a JavaScript expression is true (see $where).

WithinCircle(string, double, double, double)

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

WithinCircle(string, double, double, double, bool)

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

WithinPolygon(string, double[,])

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

WithinRectangle(string, double, double, double, double)

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

Within<TCoordinates>(string, GeoJsonPolygon<TCoordinates>)

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