[CSHARP-3501] LINQ3: Refactor string StartsWith/Contains/EndsWith to use regular expressions in filters Created: 25/Mar/21  Updated: 28/Oct/23  Resolved: 04/Oct/21

Status: Closed
Project: C# Driver
Component/s: LINQ3
Affects Version/s: None
Fix Version/s: 2.14.0

Type: Task Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CSHARP-3404 LINQ3: Get LegacyPredicateTranslatorT... Closed
Related
related to CSHARP-3445 LINQ3: Refactor support for StartsWit... Closed
Epic Link: CSHARP-2608

 Description   

Earlier (see CSHARP-3445) we decided to use $expr to translate filter expressions that use the string StartsWith/Contains/EndsWith methods.

That decision made sense in one way because we already had support for those methods in the aggregation language.

But we have since realized that it would be better to use regular expressions after all because they can use indexes. In some cases the server can scan only a range of the index, but even when it can't use a range, it can still scan the index instead of the collection to evaluate the filter.

Additionally, the StartsWith/Contains/EndsWith methods may be preceded by some combination of ToLower/ToUpper/Trim/TrimStart/TrimEnd and those modifiers will affect the final regular expression.



 Comments   
Comment by Robert Stam [ 25/Mar/21 ]

Done but not reviewed

Generated at Wed Feb 07 21:45:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.