public final class ValidationOptions
extends java.lang.Object
Constructor and Description |
---|
ValidationOptions() |
Modifier and Type | Method and Description |
---|---|
ValidationAction |
getValidationAction()
Gets the
ValidationAction . |
ValidationLevel |
getValidationLevel()
Gets the
ValidationLevel that determines how strictly MongoDB applies the validation rules to existing documents during an
insert or update. |
Bson |
getValidator()
Gets the validation rules if set or null.
|
java.lang.String |
toString() |
ValidationOptions |
validationAction(ValidationAction validationAction)
Sets the
ValidationAction that determines whether to error on invalid documents or just warn about the violations but allow
invalid documents. |
ValidationOptions |
validationLevel(ValidationLevel validationLevel)
Sets the validation level that determines how strictly MongoDB applies the validation rules to existing documents during an insert
or update.
|
ValidationOptions |
validator(Bson validator)
Sets the validation rules for all
|
@Nullable public Bson getValidator()
public ValidationOptions validator(@Nullable Bson validator)
validator
- the validation rules@Nullable public ValidationLevel getValidationLevel()
ValidationLevel
that determines how strictly MongoDB applies the validation rules to existing documents during an
insert or update.public ValidationOptions validationLevel(@Nullable ValidationLevel validationLevel)
validationLevel
- the validation level@Nullable public ValidationAction getValidationAction()
ValidationAction
.public ValidationOptions validationAction(@Nullable ValidationAction validationAction)
ValidationAction
that determines whether to error on invalid documents or just warn about the violations but allow
invalid documents.validationAction
- the validation actionpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved