For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

Generate Validation Rules

The Validation tab allows you to manage schema validation rules for a collection.

Schema validation ensures that all documents in a collection follow a defined set of rules, such as conforming to a specific shape or only allowing a specified range of values in fields.

For details, see Set Validation Rules for Your Schema.

1

To generate validation rules, click Generate Rules.

Validation view
click to enlarge
2

To apply the validation rules, click Apply. To go back, click Cancel.

3

You can preview sample documents that match your validation rules by clicking Preview documents.

4

To confirm applying the validation rules, click Confirm. To go back, click Cancel.