Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-3501

LINQ3: Refactor string StartsWith/Contains/EndsWith to use regular expressions in filters

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.14.0
    • Affects Version/s: None
    • Component/s: LINQ3
    • Labels:
      None

      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.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: