Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14630

Investigate changes in SERVER-26991: Inconsistent handling of RegEx options

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None

      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

            Assignee:
            ian.fogelman@mongodb.com Ian Fogelman
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              2 years, 36 weeks, 6 days ago