Example usage for com.mongodb.client.model ValidationLevel MODERATE

List of usage examples for com.mongodb.client.model ValidationLevel MODERATE

Introduction

In this page you can find the example usage for com.mongodb.client.model ValidationLevel MODERATE.

Prototype

ValidationLevel MODERATE

To view the source code for com.mongodb.client.model ValidationLevel MODERATE.

Click Source Link

Document

Applies validation rules to inserts and to updates on existing valid documents.

Usage

From source file:org.springframework.data.mongodb.core.CollectionOptions.java

License:Apache License

/**
 * Create new {@link CollectionOptions} with already given settings and {@code validationLevel} set to
 * {@link ValidationLevel#MODERATE}.//www  . j  ava2s. c  om
 *
 * @return new {@link CollectionOptions}.
 * @since 2.1
 */
public CollectionOptions moderateValidation() {
    return schemaValidationLevel(ValidationLevel.MODERATE);
}