Class SelectQuery
Represents a LINQ query that has been translated to an equivalent MongoDB Find query.
public class SelectQuery : TranslatedQuery
- Inheritance
-
SelectQuery
- Inherited Members
- Extension Methods
Constructors
SelectQuery(MongoCollection, Type)
Initializes a new instance of the MongoLinqFindQuery class.
public SelectQuery(MongoCollection collection, Type documentType)
Parameters
collection
MongoCollectionThe collection being queried.
documentType
TypeThe document type.
Properties
IndexHint
Gets the BsonValue (string or document) that defines which index to use (or null if not specified);
public BsonValue IndexHint { get; }
Property Value
OfType
Gets the final result type if an OfType query operator was used (otherwise null).
public Type OfType { get; }
Property Value
OrderBy
Gets a list of Expressions that defines the sort order (or null if not specified).
public ReadOnlyCollection<OrderByClause> OrderBy { get; }
Property Value
Projection
Gets the Expression that defines the projection (or null if not specified).
public LambdaExpression Projection { get; }
Property Value
Skip
Gets the Expression that defines how many documents to skip (or null if not specified).
public int? Skip { get; }
Property Value
- int?
Take
Gets the Expression that defines how many documents to take (or null if not specified);
public int? Take { get; }
Property Value
- int?
Where
Gets the LambdaExpression that defines the where clause (or null if not specified).
public LambdaExpression Where { get; }
Property Value
Methods
BuildQuery()
Creates an IMongoQuery from the where clause (returns null if no where clause was specified).
public IMongoQuery BuildQuery()
Returns
- IMongoQuery
An IMongoQuery.
Execute()
Executes the translated Find query.
public override object Execute()
Returns
- object
The result of executing the translated Find query.
Translate(Expression)
Translates a LINQ query expression tree.
public void Translate(Expression expression)
Parameters
expression
ExpressionThe LINQ query expression tree.