First of all I\'m new to MongoDb. In MongoDb C# driver 1.9.x, i can take collections as queryable with AsQueryable method like this.
var db = client.Get
I originally had the following using mongocsharp version 1.9x:
public IQueryable SearchFor(Expression> predicate)
{
return _collection.AsQueryable()
.Where(predicate.Compile()).AsQueryable();
}
Was able to get the same results in version 2 using:
public async Task> SearchFor(Expression> predicate)
{
return await _collection.Find(Builders.Filter.Where(predicate)).ToListAsync();
}
Hope it helps.