-
Type: Bug
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.8.2, 3.12.0, 3.12.3
-
Component/s: Query Operations
-
None
com.mongodb.client.model.Filters.regex(String fieldName, Pattern pattern) doesn't respect options like CASE_INSENSITIVE.
Pattern p = Pattern.compile("(.)" + name.toLowerCase() + "(.)", Pattern.CASE_INSENSITIVE);
FindIterable<MongoEvent> me = collection.find(Filters.regex("name", p));
if translated to this command:
'{ "find" : "test.test_account", "filter" : { "name" : { "$regularExpression" :
{ "pattern" : "(.*)s1lvcvky(.*)", "options" : "" }} } }'
So, upgrading my driver wrapper broke everything because compiled Pattern regular expressions are no longer supported properly. Driver wrapper doesn't support regex options, ie regex(String fieldName, String pattern, String options).
Only related bug I found had to do with Pattern codec tests.
- related to
-
JAVA-1426 PatternCodec should handle unsupported regex flags better.
- Closed