Create a $_internalSchemaUniqueItems MatchExpression

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.5.10
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • Query 2017-07-10, Query 2017-07-31
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Proposed Syntax
      { <field>: { $_internalSchemaUniqueItems: true } }
      

      The match expression takes a single value: the boolean true. It matches an array whose elements are all unique, according to our definition of equality.

      With this, we could implement JSON Schema's "uniqueItems" validation keyword by compiling it to the MatchExpression

      {$or: [{<field>: {$not: {$type: "array"}}}, {<field>: {$uniqueItems: true}}]}
      

            Assignee:
            Kyle Suarez (Inactive)
            Reporter:
            Kyle Suarez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: