4

I am quite new to LiteDB. In my attempts to create a more or less complex query using a combination of partial comparisons along different fields conjugated by the logical 'and' I am using the LiteDB's Query.And() method, like

// This is what I am missing!
BsonExpression  be  = BsonExpression.True;

if (!String.IsNullOrEmpty(property1))
{
   be  = Query.And(be, Query.EQ("Property1", property1));
}

if (!String.IsNullOrEmpty(property2))
{
   be  = Query.And(be, Query.EQ("Property2", property2));
}
// ...etc

What I mean, is there any possibility to have a proper method returning "true" in BsonExpression or elsewhere?

Alex Konnen
  • 717
  • 6
  • 20

0 Answers0