Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29580

Create a $_internalSchemaPatternProperties MatchExpression

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • Query 2017-07-10, Query 2017-07-31

      Proposed Syntax

      $_internalSchemaPatternProperties imposes sub-schemas on fields of an object, based on whether or not they match a regex. It has the following form:

      { $_internalSchemaPatternProperties: <regex-expression-list> }
      

      <regex-expression-list> has the following form:

      [
          {regex: <regex>, expression: <MatchExpression>},
          ....
      ]
      

      To constrain a subobject, wrap it in an $objectMatch:

      { <field>: $objectMatch: { $_internalSchemaPatternProperties: <regex-expression-list> } }
      

            Assignee:
            natalia.jacobowitz Natalia Jacobowitz
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: