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

Document Validation

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.3
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Epic Link:
    • Sprint:
      Quint Iteration 3

      Description

      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)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: