



The year of birth is no later than 1994.That the value falls within a given rangeĪs an example, the following snippet adds a rule to the contacts collection that validates:.That the value is in a particular format (regular expressions can be used to check if the contents of the string matches a particular pattern – that it’s a properly formatted email address, for example).If it does exist, that the value is of the correct type.For any key it might be appropriate to check: There is significant flexibility to customize which parts of the documents are and are not validated for any collection. As a result, DBAs can apply data governance standards, while developers maintain the benefits of a flexible document model. Users can enforce checks on document structure, data types, data ranges, and the presence of mandatory fields. Rather than delegating enforcement of these controls back into application code, MongoDB provides Document Validation within the database. Document Validation: Data Governance for Dynamic Schemaĭynamic schemas bring great agility, but it is also important that controls can be implemented to maintain data quality, especially if the database is powering multiple applications, or is integrated into a larger data management platform that feeds into upstream and downstream systems. Remember, you can get the detail now on everything MongoDB 3.2 offers by downloading the What’s New white paper. In this post, I’ll cover features designed to support mission-critical applications, including document validation and the enhanced replication protocol. In part 3 we’ll cover new tools and integrations supporting data analysts, DBAs, and operations teams.In part 1 we covered the new storage engines and the use-cases they served.Welcome to part 2 of our 3-part MongoDB 3.4 blog series.
