.Net MongoDB: Filter with condition calculated in a method returning a bool

Viewed 14

i have an aggregation result, and i want to filer this result after checking every row field

How can i do a filter passing by a method returning a bool? My code:

var filter= Builders<House>.Filter.Where(x => VerifDistance(x.Latitude, x.Longitude, locationModel));
 var result= DbCollection
            .Aggregate()
            .Match(filter)
            .ToListAsync();

this code generate an unsupported filter exception.

thank you for the help

0 Answers
Related