Class representing criteria for document validation, to be applied to a collection.
More...
#include <validation_criteria.hpp>
Class representing criteria for document validation, to be applied to a collection.
- See also
- https://docs.mongodb.org/manual/core/document-validation/
A class to represent the different validation action options.
- Todo:
- document enum values
Set a validation action to run when documents failing validation are inserted or modified.
- Parameters
-
action | A validation action, either "error" or "warn." |
Set a validation level.
- Parameters
-
level | A validation level, "off," "strict," or "moderate." |
- Todo:
- document this method
Set a validation rule for this validation object.
- Parameters
-
rule | Document representing a validation rule. |
Return a bson document representing this set of validation criteria.
- Returns
- Validation criteria, as a document.
The documentation for this class was generated from the following file: