C# Class MongoDB.Driver.Builders.Query

A builder for creating queries.
Mostrar archivo Open project: Qiredev/mongo-csharp-driver

Public Methods

Method Description
All ( string name ) : QueryConditionList

Adds a $all test to the query.

All ( string name, IEnumerable values ) : QueryConditionList

Adds a $all test to the query.

And ( ) : QueryComplete

Combines subqueries with an and operator.

EQ ( string name, BsonValue value ) : QueryComplete

Adds an equality test to the query.

ElemMatch ( string name, IMongoQuery query ) : QueryConditionList

Adds an $elemMatch test to the query.

Exists ( string name, bool exists ) : QueryConditionList

Adds a $exist test to the query.

GT ( string name, BsonValue value ) : QueryConditionList

Adds a $gt test to the query.

GTE ( string name, BsonValue value ) : QueryConditionList

Adds a $gte test to the query.

In ( string name ) : QueryConditionList

Adds a $in test to the query.

In ( string name, IEnumerable values ) : QueryConditionList

Adds a $in test to the query.

LT ( string name, BsonValue value ) : QueryConditionList

Adds a $lt test to the query.

LTE ( string name, BsonValue value ) : QueryConditionList

Adds a $lte test to the query.

Matches ( string name, BsonRegularExpression regex ) : QueryComplete

Adds a regular expression test to the query.

Mod ( string name, int modulus, int equals ) : QueryConditionList

Adds a $mod test to the query.

NE ( string name, BsonValue value ) : QueryConditionList

Adds a $ne test to the query.

Near ( string name, double x, double y ) : QueryConditionList

Adds a $near test to the query.

Near ( string name, double x, double y, double maxDistance ) : QueryConditionList

Adds a $near test to the query.

Near ( string name, double x, double y, double maxDistance, bool spherical ) : QueryConditionList

Adds a $near or $nearSphere test to the query.

Nor ( ) : QueryComplete

Combines subqueries with a nor operator.

Not ( string name ) : QueryNot

Adds a $not test to the query.

NotIn ( string name ) : QueryConditionList

Adds a $nin test to the query.

NotIn ( string name, IEnumerable values ) : QueryConditionList

Adds a $nin test to the query.

Or ( ) : QueryComplete

Combines subqueries with an or operator.

Size ( string name, int size ) : QueryConditionList

Adds a $size test to the query.

Type ( string name, BsonType type ) : QueryConditionList

Adds a $type test to the query.

Where ( BsonJavaScript javaScript ) : QueryComplete

Adds a $where test to the query.

WithinCircle ( string name, double centerX, double centerY, double radius ) : QueryConditionList

Adds a $within/$center test to the query.

WithinCircle ( string name, double centerX, double centerY, double radius, bool spherical ) : QueryConditionList

Adds a $within/$center or $within/$centerSphere test to the query.

WithinRectangle ( string name, double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY ) : QueryConditionList

Adds a $within/$box test to the query.

Method Details

All() public static method

Adds a $all test to the query.
public static All ( string name ) : QueryConditionList
name string The name of the element to test.
return QueryConditionList

All() public static method

Adds a $all test to the query.
public static All ( string name, IEnumerable values ) : QueryConditionList
name string The name of the element to test.
values IEnumerable A BsonArray of values.
return QueryConditionList

And() public static method

Combines subqueries with an and operator.
public static And ( ) : QueryComplete
return QueryComplete

EQ() public static method

Adds an equality test to the query.
public static EQ ( string name, BsonValue value ) : QueryComplete
name string The name of the element to test.
value BsonValue The value to compare to.
return QueryComplete

ElemMatch() public static method

Adds an $elemMatch test to the query.
public static ElemMatch ( string name, IMongoQuery query ) : QueryConditionList
name string The name of the element to test.
query IMongoQuery The query to match elements with.
return QueryConditionList

Exists() public static method

Adds a $exist test to the query.
public static Exists ( string name, bool exists ) : QueryConditionList
name string The name of the element to test.
exists bool Whether to test for the existence or absence of an element.
return QueryConditionList

GT() public static method

Adds a $gt test to the query.
public static GT ( string name, BsonValue value ) : QueryConditionList
name string The name of the element to test.
value BsonValue The value to compare to.
return QueryConditionList

GTE() public static method

Adds a $gte test to the query.
public static GTE ( string name, BsonValue value ) : QueryConditionList
name string The name of the element to test.
value BsonValue The value to compare to.
return QueryConditionList

In() public static method

Adds a $in test to the query.
public static In ( string name ) : QueryConditionList
name string The name of the element to test.
return QueryConditionList

In() public static method

Adds a $in test to the query.
public static In ( string name, IEnumerable values ) : QueryConditionList
name string The name of the element to test.
values IEnumerable A BsonArray of values.
return QueryConditionList

LT() public static method

Adds a $lt test to the query.
public static LT ( string name, BsonValue value ) : QueryConditionList
name string The name of the element to test.
value BsonValue The value to compare to.
return QueryConditionList

LTE() public static method

Adds a $lte test to the query.
public static LTE ( string name, BsonValue value ) : QueryConditionList
name string The name of the element to test.
value BsonValue The value to compare to.
return QueryConditionList

Matches() public static method

Adds a regular expression test to the query.
public static Matches ( string name, BsonRegularExpression regex ) : QueryComplete
name string The name of the element to test.
regex BsonRegularExpression The regular expression to match against.
return QueryComplete

Mod() public static method

Adds a $mod test to the query.
public static Mod ( string name, int modulus, int equals ) : QueryConditionList
name string The name of the element to test.
modulus int The modulus.
equals int The value to compare to.
return QueryConditionList

NE() public static method

Adds a $ne test to the query.
public static NE ( string name, BsonValue value ) : QueryConditionList
name string The name of the element to test.
value BsonValue The value to compare to.
return QueryConditionList

Near() public static method

Adds a $near test to the query.
public static Near ( string name, double x, double y ) : QueryConditionList
name string The name of the element to test.
x double The x value of the origin.
y double The y value of the origin.
return QueryConditionList

Near() public static method

Adds a $near test to the query.
public static Near ( string name, double x, double y, double maxDistance ) : QueryConditionList
name string The name of the element to test.
x double The x value of the origin.
y double The y value of the origin.
maxDistance double The max distance for a document to be included in the results.
return QueryConditionList

Near() public static method

Adds a $near or $nearSphere test to the query.
public static Near ( string name, double x, double y, double maxDistance, bool spherical ) : QueryConditionList
name string The name of the element to test.
x double The x value of the origin.
y double The y value of the origin.
maxDistance double The max distance for a document to be included in the results.
spherical bool Whether to do a spherical search.
return QueryConditionList

Nor() public static method

Combines subqueries with a nor operator.
public static Nor ( ) : QueryComplete
return QueryComplete

Not() public static method

Adds a $not test to the query.
public static Not ( string name ) : QueryNot
name string The name of the element to test.
return QueryNot

NotIn() public static method

Adds a $nin test to the query.
public static NotIn ( string name ) : QueryConditionList
name string The name of the element to test.
return QueryConditionList

NotIn() public static method

Adds a $nin test to the query.
public static NotIn ( string name, IEnumerable values ) : QueryConditionList
name string The name of the element to test.
values IEnumerable A BsonArray of values.
return QueryConditionList

Or() public static method

Combines subqueries with an or operator.
public static Or ( ) : QueryComplete
return QueryComplete

Size() public static method

Adds a $size test to the query.
public static Size ( string name, int size ) : QueryConditionList
name string The name of the array element to test.
size int The size of the array.
return QueryConditionList

Type() public static method

Adds a $type test to the query.
public static Type ( string name, BsonType type ) : QueryConditionList
name string The name of the element to test.
type BsonType The type.
return QueryConditionList

Where() public static method

Adds a $where test to the query.
public static Where ( BsonJavaScript javaScript ) : QueryComplete
javaScript BsonJavaScript The where clause.
return QueryComplete

WithinCircle() public static method

Adds a $within/$center test to the query.
public static WithinCircle ( string name, double centerX, double centerY, double radius ) : QueryConditionList
name string The name of the element to test.
centerX double The x coordinate of the origin.
centerY double The y coordinate of the origin.
radius double The radius of the circle.
return QueryConditionList

WithinCircle() public static method

Adds a $within/$center or $within/$centerSphere test to the query.
public static WithinCircle ( string name, double centerX, double centerY, double radius, bool spherical ) : QueryConditionList
name string The name of the element to test.
centerX double The x coordinate of the origin.
centerY double The y coordinate of the origin.
radius double The radius of the circle.
spherical bool Whether to do a spherical search.
return QueryConditionList

WithinRectangle() public static method

Adds a $within/$box test to the query.
public static WithinRectangle ( string name, double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY ) : QueryConditionList
name string The name of the element to test.
lowerLeftX double The x coordinate of the lower left corner.
lowerLeftY double The y coordinate of the lower left corner.
upperRightX double The x coordinate of the upper right corner.
upperRightY double The y coordinate of the upper right corner.
return QueryConditionList