-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: JavaScript, Querying, Shell, Tools
-
Minor Change
-
ALL
-
v4.4
-
Query Execution 2021-06-28, Query Execution 2021-07-12
The server documents certain regex modifiers it supports: imxs
https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_options
It is actually inconsistent within itself of which options it supports:
gim: https://github.com/mongodb/mongo/blob/r3.4.0-rc3/src/mongo/bson/bsonelement.cpp#L245-L264
imxs: https://github.com/mongodb/mongo/blob/r3.4.0-rc3/src/mongo/db/matcher/expression_leaf.cpp#L232-L244
These modifiers are inconsistent with BSON Regex modifiers: imxlsu
http://bsonspec.org/spec.html
The shell however only allows and supports: gimy
https://github.com/mongodb/mongo/blob/r3.4.0-rc3/src/third_party/mozjs-45/extract/js/src/vm/RegExpObject.cpp#L933-L955
The server tools allow and support yet another set: gims
https://github.com/mongodb/mongo/blob/r3.4.0-rc3/src/mongo/gotools/common/bsonutil/bsonutil.go#L282-L287
- duplicates
-
SERVER-57079 Regex with "u" option fails on 5.0.0-alpha0
- Closed
- is depended on by
-
PYTHON-2721 Test failure - invalid flag in regex options on v5.0.0-alpha0-442-g0520668
- Closed
- is related to
-
TOOLS-2916 extended json supported regex flags removed from extended json spec
- Accepted
- related to
-
SERVER-26992 Sorting on regex field should not depend on the order of regex options
- Backlog