// using MongoDB.Driver namespace var collection = database.GetCollection("myCollection"); var pipeline = collection.Aggregate() .Match(Builders .Filter.Eq("status", "active")); var result = pipeline.ToList();
// using MongoDB.Driver namespace var collection = database.GetCollectionPackage library: MongoDB.Driver.("myCollection"); var regex = new BsonRegularExpression("^Joh"); var pipeline = collection.Aggregate() .Match(Builders .Filter.Regex("name", regex)); var result = pipeline.ToList();