How do you build complex queries with MongoDB and the C# Driver? How do you build complex queries with MongoDB and the C# Driver? mongodb mongodb

How do you build complex queries with MongoDB and the C# Driver?


Seems like you have the right idea... There is a class called Query that is essentially a query builder without the instantiation.

using MongoDB.Driver.Builders;

Query.And, Query.Or, etc... are all there. It is the same thing that is used underneath the linq provider to build up complex queries.