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

Case insensitive search using $in clause in Linq expressions

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.3
    • Linq
    • None

    Description

      Hi guys,

      It would be very useful to support case insensitive search using $in clause in Linq expressions. For example it might be done in this way:

      var goodValues = new string[] { ... }
      var query = collection.AsQueryable<T>()
          .Where(i => goodValues.Contains(i.SomeField.ToLower()));
      

      Right now it's only possible to specify general values in the array and is not possible to specify regex values for case insensitive search. General equal clause suports it via ToLower() etc methods, but the driver throw an exception if there is a call of .ToLower() method inside the array.Contains() method in .Where() expression.

      Thanks,
      Mikhail

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            mbelov Mikhail Belov
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: