C# Class CSMongo.Query.MongoQuery

Handles building a query and generating records
Inheritance: MongoQueryBase
Show file Open project: hugoware/CSMongo

Public Methods

Method Description
All ( string field ) : MongoQuery

Finds fields that match all value within the record

All ( string field, IEnumerable values ) : MongoQuery

Finds fields that match all value within the record

AppendParameter ( string field, string modifier, object value ) : MongoQuery

Allows you to append a query option using the Mongo syntax

Count ( ) : long

Determines the total count of records matching this query

Delete ( ) : void

Performs a selection of all fields matching the query

EqualTo ( string field, object value ) : MongoQuery

Finds all records that are equal to the value provided

Exists ( string field ) : MongoQuery

Finds records that the requested field exists in

FindById ( MongoOid id ) : MongoQuery

Finds a record based on the Oid value

FindById ( byte id ) : MongoQuery

Finds a record based on the Oid value

FindById ( string id ) : MongoQuery

Finds a record based on the Oid value

Greater ( string field, object value ) : MongoQuery

Finds all records greater than the provided value

GreaterOrEqual ( string field, object value ) : MongoQuery

Finds all records greater than or equal to the provided value

In ( string field ) : MongoQuery

Finds fields that match any value within the record

In ( string field, IEnumerable values ) : MongoQuery

Finds fields that match any value within the record

Increment ( ) : void

Increments each of the fields provided by one

Increment ( BsonDocument document ) : void

Increments each of the fields by the number provides - first converting the value to an integer

Increment ( object parameters ) : void

Increments each of the fields by the number provides - first converting the value to an integer

Less ( string field, object value ) : MongoQuery

Finds all records less than the provided value

LessOrEqual ( string field, object value ) : MongoQuery

Finds all records less than or equal to the provided value

Match ( string field, Regex expression ) : MongoQuery

Finds all records that match the provided expression

Match ( string field, string expression ) : MongoQuery

Finds all records that match the provided expression

Match ( string field, string expression, RegexOptions options ) : MongoQuery

Finds all records that match the provided expression

Mod ( string field, int value ) : MongoQuery

Performs a modulo comparison (field % value == 1)

Mod ( string field, int value, int compare ) : MongoQuery

Performs a modulo comparison (field % value == compare)

MongoQuery ( MongoCollection collection ) : System

Creates a new query for this database

MongoQuery ( MongoDatabase database, string collection ) : System

Creates a new query for this database

NotEqualTo ( string field, object value ) : MongoQuery

Finds all records that are not equal to the value provided

NotExists ( string field ) : MongoQuery

Finds records that the requested field does not exist in

NotIn ( string field ) : MongoQuery

Finds fields that haven't any matches within the array

NotIn ( string field, IEnumerable values ) : MongoQuery

Finds fields that haven't any matches within the collection

Select ( ) : IEnumerable

Selects the records from the database that matches this query

Select ( QueryOptionTypes options ) : IEnumerable

Selects the records from the database that matches this query

Select ( int skip, int take ) : IEnumerable

Selects the records from the database that matches this query

Select ( int skip, int take, QueryOptionTypes options ) : IEnumerable

Selects the records from the database that matches this query

SelectOne ( ) : MongoDocument

Selects only one document with the provided parameters

SelectOne ( QueryOptionTypes options ) : MongoDocument

Selects only one document with the provided parameters

SelectOne ( int skip ) : MongoDocument

Selects only one document with the provided parameters

SelectOne ( int skip, QueryOptionTypes options ) : MongoDocument

Selects only one document with the provided parameters

Set ( BsonDocument document ) : void

Updates all matching records with the values on the provided BsonDocument or adds the new item to object entirely

Set ( object changes ) : void

Updates all matching records with the values on the provided object or adds the new item to object entirely

Size ( string field, int size ) : MongoQuery

Finds fields that match all value within the record

Unset ( ) : void

Removes all matching fields from each document in the query

Where ( string script ) : MongoQuery

Writes a manual function to persom a comparison on the server

Where ( string script, bool wrapWithFunction ) : MongoQuery

Writes a manual function to perform a comparison on the server

Private Methods

Method Description
_SendUpdate ( string type, UpdateOptionTypes options, BsonDocument changes ) : void

Method Details

All() public method

Finds fields that match all value within the record
public All ( string field ) : MongoQuery
field string
return MongoQuery

All() public method

Finds fields that match all value within the record
public All ( string field, IEnumerable values ) : MongoQuery
field string
values IEnumerable
return MongoQuery

AppendParameter() public method

Allows you to append a query option using the Mongo syntax
public AppendParameter ( string field, string modifier, object value ) : MongoQuery
field string
modifier string
value object
return MongoQuery

Count() public method

Determines the total count of records matching this query
public Count ( ) : long
return long

Delete() public method

Performs a selection of all fields matching the query
public Delete ( ) : void
return void

EqualTo() public method

Finds all records that are equal to the value provided
public EqualTo ( string field, object value ) : MongoQuery
field string
value object
return MongoQuery

Exists() public method

Finds records that the requested field exists in
public Exists ( string field ) : MongoQuery
field string
return MongoQuery

FindById() public method

Finds a record based on the Oid value
public FindById ( MongoOid id ) : MongoQuery
id MongoOid
return MongoQuery

FindById() public method

Finds a record based on the Oid value
public FindById ( byte id ) : MongoQuery
id byte
return MongoQuery

FindById() public method

Finds a record based on the Oid value
public FindById ( string id ) : MongoQuery
id string
return MongoQuery

Greater() public method

Finds all records greater than the provided value
public Greater ( string field, object value ) : MongoQuery
field string
value object
return MongoQuery

GreaterOrEqual() public method

Finds all records greater than or equal to the provided value
public GreaterOrEqual ( string field, object value ) : MongoQuery
field string
value object
return MongoQuery

In() public method

Finds fields that match any value within the record
public In ( string field ) : MongoQuery
field string
return MongoQuery

In() public method

Finds fields that match any value within the record
public In ( string field, IEnumerable values ) : MongoQuery
field string
values IEnumerable
return MongoQuery

Increment() public method

Increments each of the fields provided by one
public Increment ( ) : void
return void

Increment() public method

Increments each of the fields by the number provides - first converting the value to an integer
public Increment ( BsonDocument document ) : void
document CSMongo.Bson.BsonDocument
return void

Increment() public method

Increments each of the fields by the number provides - first converting the value to an integer
public Increment ( object parameters ) : void
parameters object
return void

Less() public method

Finds all records less than the provided value
public Less ( string field, object value ) : MongoQuery
field string
value object
return MongoQuery

LessOrEqual() public method

Finds all records less than or equal to the provided value
public LessOrEqual ( string field, object value ) : MongoQuery
field string
value object
return MongoQuery

Match() public method

Finds all records that match the provided expression
public Match ( string field, Regex expression ) : MongoQuery
field string
expression System.Text.RegularExpressions.Regex
return MongoQuery

Match() public method

Finds all records that match the provided expression
public Match ( string field, string expression ) : MongoQuery
field string
expression string
return MongoQuery

Match() public method

Finds all records that match the provided expression
public Match ( string field, string expression, RegexOptions options ) : MongoQuery
field string
expression string
options RegexOptions
return MongoQuery

Mod() public method

Performs a modulo comparison (field % value == 1)
public Mod ( string field, int value ) : MongoQuery
field string
value int
return MongoQuery

Mod() public method

Performs a modulo comparison (field % value == compare)
public Mod ( string field, int value, int compare ) : MongoQuery
field string
value int
compare int
return MongoQuery

MongoQuery() public method

Creates a new query for this database
public MongoQuery ( MongoCollection collection ) : System
collection MongoCollection
return System

MongoQuery() public method

Creates a new query for this database
public MongoQuery ( MongoDatabase database, string collection ) : System
database MongoDatabase
collection string
return System

NotEqualTo() public method

Finds all records that are not equal to the value provided
public NotEqualTo ( string field, object value ) : MongoQuery
field string
value object
return MongoQuery

NotExists() public method

Finds records that the requested field does not exist in
public NotExists ( string field ) : MongoQuery
field string
return MongoQuery

NotIn() public method

Finds fields that haven't any matches within the array
public NotIn ( string field ) : MongoQuery
field string
return MongoQuery

NotIn() public method

Finds fields that haven't any matches within the collection
public NotIn ( string field, IEnumerable values ) : MongoQuery
field string
values IEnumerable
return MongoQuery

Select() public method

Selects the records from the database that matches this query
public Select ( ) : IEnumerable
return IEnumerable

Select() public method

Selects the records from the database that matches this query
public Select ( QueryOptionTypes options ) : IEnumerable
options QueryOptionTypes
return IEnumerable

Select() public method

Selects the records from the database that matches this query
public Select ( int skip, int take ) : IEnumerable
skip int
take int
return IEnumerable

Select() public method

Selects the records from the database that matches this query
public Select ( int skip, int take, QueryOptionTypes options ) : IEnumerable
skip int
take int
options QueryOptionTypes
return IEnumerable

SelectOne() public method

Selects only one document with the provided parameters
public SelectOne ( ) : MongoDocument
return MongoDocument

SelectOne() public method

Selects only one document with the provided parameters
public SelectOne ( QueryOptionTypes options ) : MongoDocument
options QueryOptionTypes
return MongoDocument

SelectOne() public method

Selects only one document with the provided parameters
public SelectOne ( int skip ) : MongoDocument
skip int
return MongoDocument

SelectOne() public method

Selects only one document with the provided parameters
public SelectOne ( int skip, QueryOptionTypes options ) : MongoDocument
skip int
options QueryOptionTypes
return MongoDocument

Set() public method

Updates all matching records with the values on the provided BsonDocument or adds the new item to object entirely
public Set ( BsonDocument document ) : void
document CSMongo.Bson.BsonDocument
return void

Set() public method

Updates all matching records with the values on the provided object or adds the new item to object entirely
public Set ( object changes ) : void
changes object
return void

Size() public method

Finds fields that match all value within the record
public Size ( string field, int size ) : MongoQuery
field string
size int
return MongoQuery

Unset() public method

Removes all matching fields from each document in the query
public Unset ( ) : void
return void

Where() public method

Writes a manual function to persom a comparison on the server
public Where ( string script ) : MongoQuery
script string
return MongoQuery

Where() public method

Writes a manual function to perform a comparison on the server
public Where ( string script, bool wrapWithFunction ) : MongoQuery
script string
wrapWithFunction bool
return MongoQuery