-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: 4.1.0
-
Component/s: Documentation
-
None
-
Fully Compatible
There are three different overloads of com.mongodb.client.model.Filters.regex():
- regex(String fieldName, String pattern)
- regex(String fieldName, String pattern, String options)
- regex(String fieldName, Pattern pattern)
All three of these overloads have the same Javadoc text:
Creates a filter that matches all documents where the value of the field matches the given regular expression pattern with the given options applied.
However, only one of these methods actually takes in options. The (String, String) variation corresponds to no options, and the (String, Pattern) variation presumably uses the compiled Pattern's match flags.
I would expect the two overloads that lack an "options" argument to either not mention it, or to specify how it actually affects the options rather than reference nonexistent "given options".