[DOCS-14630] Investigate changes in SERVER-26991: Inconsistent handling of RegEx options Created: 07/Jul/21  Updated: 29/Oct/23  Resolved: 10/Nov/21

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Ian Fogelman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-26991 Inconsistent handling of RegEx options Closed
Related
related to DOCS-14628 [Server] extended json supported rege... Backlog
Participants:
Days since reply: 2 years, 13 weeks, 1 day ago
Epic Link: DOCSP-14300
Story Points: 3

 Description   
Downstream Change Summary

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



 Comments   
Comment by Githook User [ 09/Nov/21 ]

Author:

{'name': 'ian fogelman', 'email': 'ian.fogelman@mongodb.com', 'username': 'ianf-mongodb'}

Message: DOCS-14630 5.1 regex functionality updates
Branch: master
https://github.com/mongodb/docs/commit/cb087c4c4bbae986c97bd6a970a15a1976541953

Comment by Mickey Winters [ 07/Jul/21 ]

see https://jira.mongodb.org/browse/DOCS-14628 for something I already found in the extended json docs semi related to this

Generated at Thu Feb 08 08:10:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.