-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Yes, currently, the Query class has the Contains and StartsWith methods, but it lacks an EndsWith method. This limits the ability to efficiently query strings that should end with a specific value.
Describe the solution you'd like
I would like to see an EndsWith method added to the Query class, similar to the existing Contains and StartsWith methods. This would allow for more flexible string querying, particularly when checking for specific suffixes in a string.
Describe alternatives you've considered
- Using an expression directly: Find(x => x.Content.EndsWith("value"))
- Using a raw query string:
$"$ .Content LIKE {new BsonValue("%" + value)}"
While these alternatives are functional, they require more verbose and less intuitive code compared to having a built-inEndsWithmethod in theQueryclass.
Additional context
The addition of the EndsWith method would make string querying more complete and provide better support for common patterns where the end of the string matters.