dj-nitehawk / MongoDB.Entities

A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management
https://mongodb-entities.com
MIT License
547 stars 70 forks source link

About the MongoDB.Driver.Linq.ExpressionNotSupportedException #193

Closed thepra closed 1 year ago

thepra commented 1 year ago

I'm getting quite many of those exceptions when using more or less complex Match(e => <condition>), ex:

DB.Find\<User>().Match(u => workersRolesFilter.Contains(u.Role.Name) && u.DeletionDate == null).ExecuteAsync(token);

Am I supposed to use instead DB.Queryable<User>() .Where(...) for such queries? If yes, what are the limits of Match(e => ...)?

thepra commented 1 year ago

It's weird, it's as if despite throwing MongoDB.Driver.Linq.ExpressionNotSupportedException it does return in the end a valid and filtered result... And Queryable<T>() doesn't help either. Should I ignore this exceptions?

dj-nitehawk commented 1 year ago

gonna need a self contained repro to look in to this. it doesn't seem to throw with stuff i tried.