-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.3
-
Component/s: Linq
-
None
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:
Unable to find source-code formatter for language: csharp. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
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
- duplicates
-
CSHARP-1950 Allow string or regular expressions in values for $in with string
- Closed