The MongoDB documentation talks about how a validation document can be defined in a collection that can be run during insert or update.
For example, a collection with an email field can be validated with a regular expression, and insertion may succeed or fail depending on how the collection was configured at creation time.
I was not able to find a similar feature for the C # driver for MongoDB.
Isn't it supported yet?
This ship may have sailed, but if others stumble over this issue. It has been implemented.
#, #. , ( collMod, ). CreateCollectionOptions Validator, ValidationAction ValidationLevel. CreateCollectionOptions - , CreateCollection. , .
collMod
CreateCollectionOptions
Validator
ValidationAction
ValidationLevel
CreateCollection