-
Type:
Improvement
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: 1.8.3
-
Component/s: LINQ
-
None
Consider either of the following:
MongoQueryable<T> mongoQuery = query as MongoQueryable<T>;
if (mongoQuery != null)
return mongoQuery.GetMongoQuery();
MongoCursor<T> mongoCursor = query as MongoCursor<T>;
if (mongoCursor != null)
return mongoCursor.Query;
Calling ToString on either mongoQuery.GetMongoQuery() or mongoCursor.Query. It will return the where clause of a query. But as far as I can tell, there is no way to access other parts of the query such as sort, limit, skip, projects, etc.
So if I had:
var query =
(from p in people
where p.age > 21
orderby p.Name descending)
.Skip(20)
.Take(10)
The query part is {age: {$gt: 21} } but I haven't found a way to access the rest of the query. Am I missing it or is this aspect inaccessible from the outside?