MongoDB C++ Driver
mongocxx-3.10.2
|
Class representing criteria for document validation, to be applied to a collection. More...
#include <validation_criteria.hpp>
Public Types | |
enum class | validation_level |
A class to represent the different validation level options. More... | |
enum class | validation_action |
A class to represent the different validation action options. More... | |
Public Member Functions | |
validation_criteria & | rule (bsoncxx::v_noabi::document::view_or_value rule) |
Sets a validation rule for this validation object. More... | |
const stdx::optional< bsoncxx::v_noabi::document::view_or_value > & | rule () const |
Gets the validation rule for this validation object. More... | |
validation_criteria & | level (validation_level level) |
Sets a validation level. More... | |
const stdx::optional< validation_level > & | level () const |
Gets the validation level. More... | |
validation_criteria & | action (validation_action action) |
Sets a validation action to run when documents failing validation are inserted or modified. More... | |
const stdx::optional< validation_action > & | action () const |
Gets the validation action to run when documents failing validation are inserted or modified. More... | |
bsoncxx::v_noabi::document::value | to_document () const |
Returns a bson document representing this set of validation criteria. More... | |
operator bsoncxx::v_noabi::document::value () const | |
Class representing criteria for document validation, to be applied to a collection.
A class to represent the different validation action options.
A class to represent the different validation level options.
const stdx::optional<validation_action>& mongocxx::v_noabi::validation_criteria::action | ( | ) | const |
Gets the validation action to run when documents failing validation are inserted or modified.
validation_criteria& mongocxx::v_noabi::validation_criteria::action | ( | validation_action | action | ) |
Sets a validation action to run when documents failing validation are inserted or modified.
action | An enumerated validation action. |
const stdx::optional<validation_level>& mongocxx::v_noabi::validation_criteria::level | ( | ) | const |
Gets the validation level.
validation_criteria& mongocxx::v_noabi::validation_criteria::level | ( | validation_level | level | ) |
Sets a validation level.
level | An enumerated validation level. |
mongocxx::v_noabi::validation_criteria::operator bsoncxx::v_noabi::document::value | ( | ) | const |
To determine which options are set on this object, use the provided accessors instead.
const stdx::optional<bsoncxx::v_noabi::document::view_or_value>& mongocxx::v_noabi::validation_criteria::rule | ( | ) | const |
Gets the validation rule for this validation object.
validation_criteria& mongocxx::v_noabi::validation_criteria::rule | ( | bsoncxx::v_noabi::document::view_or_value | rule | ) |
Sets a validation rule for this validation object.
rule | Document representing a validation rule. |
bsoncxx::v_noabi::document::value mongocxx::v_noabi::validation_criteria::to_document | ( | ) | const |
Returns a bson document representing this set of validation criteria.