Package dev.morphia.annotations
Annotation Type Validation
-
@Documented @Inherited @Retention(RUNTIME) @Target(TYPE) public @interface Validation
Defines the document validation logic for a collection.- Since:
- 1.3
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description ValidationAction
action
ValidationLevel
level
-
-
-
Element Detail
-
value
String value
- Returns:
- the query used to validate documents in a collection. This query is not validated so care must be taken to ensure document field names and types are correct.
- MongoDB documentation
- core/document-validation/
-
-
-
level
ValidationLevel level
- Returns:
- how strictly MongoDB should apply the validation rules to existing documents during an insert or update.
- See Also:
ValidationLevel
- Default:
- com.mongodb.client.model.ValidationLevel.STRICT
-
-
-
action
ValidationAction action
- Returns:
- how strictly MongoDB should apply the validation rules to existing documents during an insert or update.
- See Also:
ValidationAction
- Default:
- com.mongodb.client.model.ValidationAction.ERROR
-
-