Example usage for com.mongodb.client.model ValidationAction ERROR

List of usage examples for com.mongodb.client.model ValidationAction ERROR

Introduction

In this page you can find the example usage for com.mongodb.client.model ValidationAction ERROR.

Prototype

ValidationAction ERROR

To view the source code for com.mongodb.client.model ValidationAction ERROR.

Click Source Link

Document

Documents must pass validation before the write occurs.

Usage

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

License:Apache License

/**
 * Create new {@link CollectionOptions} with already given settings and {@code validationAction} set to
 * {@link ValidationAction#ERROR}./*  w w w  .j  a v a  2  s.  com*/
 *
 * @return new {@link CollectionOptions}.
 * @since 2.1
 */
public CollectionOptions failOnValidationError() {
    return schemaValidationAction(ValidationAction.ERROR);
}