-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
Find queries no longer ignore invalid regex flags, this makes it consistent with the behavior of the aggregate command and inside a projection.
After upgrading to a version with this patch, if a collection has document validation configured with an invalid regex flag the server will log a warning and then prevent inserts until the DBA uses collMod to update the validator and no longer have an invalid flag
Description of Linked Ticket
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
- documents
-
SERVER-26991 Inconsistent handling of RegEx options
- Closed
- related to
-
DOCS-14628 [Server] extended json supported regex flags removed from extended json spec
- Closed