Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-950

Allow users to specify array validation that applies to all array elements

    • Type: Icon: Task Task
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • 1.18.0
    • Affects Version/s: None
    • Component/s: Document Validation
    • None

      General

      According to:
      https://jira.mongodb.org/browse/SERVER-27902
      it is possible to validate all entries in an array for some criteria.

      This feature request is to allow Compass users to specify which validation rules apply to arrays so that the $elemMatch plus $not matching from SERVER-27902 can be used to implement the users' expectation of validation over all elements of the array subdocument.

      Intercom conversation on the topic:
      https://app.intercom.io/a/apps/p57suhg7/users/58cdcb88d9d8a5b427c0b15f

      Considerations

      Applying the $elemMatch plus $not pattern at the leaf node of the document field specification ("field.subfield.subsubfield.leafsubsubsubfield") would be relatively straightforward. Just add another column similar to "Nullable". However, for the general case, the pattern would need to be available for an array present at any of the subfield levels. It is unclear how that kind of flexibility could be simply and intuitively represented to the user in the UI.

            Assignee:
            Unassigned Unassigned
            Reporter:
            brian.blevins@mongodb.com Brian Blevins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: