• Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.3
    • Affects Version/s: None
    • Component/s: Storage
    • Labels:
      None
    • Minor Change
    • Quint Iteration 3

      This will add the ability for users to configure a match expression on collections that all new
      documents and updates to existing documents must match. An attempt to create a document that doesn't
      match the validation will fail with error code 121 (DocumentValidationFailure).

      Validators can be set by passing the 'validator' option to the 'create' command. They can also be
      changed or added by passing a 'validator' option to the 'collMod' command. Passing
      validator: {} (a query that matches all documents) removes the validator from a collection. When a
      validator is set on a collection we only validate new objects, not existing objects.

      The following commands will support a new flag 'bypassDocumentValidation' which allows opting out of
      validation on a per-operation basis, for example when restoring potentially invalid data from a
      backup. This will require a new BypassDocumentValidation permission which is granted to the built-in
      roles 'restore' and 'dbadmin'.

      • applyOps
      • clone
      • cloneCollection
      • copyDb
      • findAndModify
      • mapReduce
      • insert (only as command)
      • update (only as command)
      • aggregate (for $out)

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            ian@mongodb.com Ian Whalen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: