Class ValidationOptions


  • public final class ValidationOptions
    extends Object
    • Constructor Detail

      • ValidationOptions

        public ValidationOptions()
      • ValidationOptions

        public ValidationOptions​(ValidationOptions validationOptions)
      • ValidationOptions

        public ValidationOptions​(JsonObject json)
    • Method Detail

      • toMongoDriverObject

        public com.mongodb.client.model.ValidationOptions toMongoDriverObject()
        Returns the mongo-java-driver specific object.
        Returns:
        com.mongodb.client.model.ValidationOptions
      • getValidator

        @Nullable
        public JsonObject getValidator()
      • setValidator

        public ValidationOptions setValidator​(@Nullable
                                              JsonObject validator)
        Optional. Allows users to specify validation rules or expressions for the collection. For more information, see Schema Validation.
        Parameters:
        validator -
        Returns:
        ValidationOptions
      • getValidationLevel

        @Nullable
        public com.mongodb.client.model.ValidationLevel getValidationLevel()
      • setValidationLevel

        public ValidationOptions setValidationLevel​(@Nullable
                                                    com.mongodb.client.model.ValidationLevel validationLevel)
        Optional. Determines how strictly MongoDB applies the validation rules to existing documents during an update.
        Parameters:
        validationLevel -
        Returns:
        ValidationOptions
      • getValidationAction

        @Nullable
        public com.mongodb.client.model.ValidationAction getValidationAction()
      • setValidationAction

        public ValidationOptions setValidationAction​(@Nullable
                                                     com.mongodb.client.model.ValidationAction validationAction)
        Optional. Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted.
        Parameters:
        validationAction -
        Returns:
        ValidationOptions
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object