Mongo C# driver - Building filter dynamically with nesting
Builders
is really flexible class, it also has overridden operators "& = AND" and "| = OR"
Your example will be
var filter = Builders<User>.Filter.Eq(x => x.A, "1");
filter &= (Builders<User>.Filter.Eq(x => x.B, "4") | Builders<User>.Filter.Eq(x => x.B, "5"));
You can use very simply like this way.....
var filter = Builders<Rental>.Filter.Where(s => s._id== id && s.Price==1500);