Enforce a Document Schema¶
You can control the shape and contents of documents in a collection by defining a document schema. Schemas are regular documents that adhere to the same JSON schema specification as the schema validation built into the core MongoDB server. You can use schemas to control the type of a field's value, require specific fields, and validate changes before committing the results of insert and update operations.
This guide walks through creating a document schema for a collection in a linked MongoDB Atlas cluster.
Data Lake data sources do not support rules. You can only access a Data Lake data source in a system function.