var query =
from p in mongo.People
where p.Age > 20 && p.Name.Length >= 2
orderby p.Age descending
select p;
But could you answer these questions?
- What *exactly* does it do on the server?
- Is it using an index or not?
Well, I just released a new .NET library on GitHub
MongoDB query helper for .NET
https://github.com/mikeckennedy/mongodb-query-helper-for-dotnet
Now these questions are easy to answer. For example:
Console.WriteLine( query.ToMongoQueryText() );
outputs
{ "Age" : { "$gt" : 20 }, "Name" : /^.{2,}$/s }
Check it out. I hope you find it useful.
Great!
Thanks Altaf.