Allows you to set a validator, a query that every new or updated document must match

Example:


db.runCommand( {
    *collMod:* "whisky",
    *validator:* {
        name: { $type: "string" },
        age: { *$type:* "integer" },
    },
    validationLevel: *"moderate"*, // off, strict
    validationAction: *"warn"*, // error, 
} )