Posted On: Oct 12, 2023
September 20, 2023 - Amazon DocumentDB now supports schema validation with $jsonSchema operator. You can now attach schema validation rules to a DocumentDB collection that are validated during inserts and updates to the collection.
Amazon DocumentDB supports a flexible JSON document model, that means documents in a collection can have different fields or data types. Using JSON schema validation, you can now specify schema rules such as field datatypes or required fields for collection having schema requirements e.g., sensor reading datatype as Double or a required email address field. You can also configure the validation rule to check documents during inserts and updates or only valid and new documents that are added after the schema validation rule was created.
Schema validation is available in Amazon DocumentDB 5.0 and 4.0 instance-based clusters and in all Amazon Web Services regions in which Amazon DocumentDB is currently present. Please visit the product documentation page to learn more about Amazon DocumentDB.