Schema Validation with $jsonSchema

A collection can refuse documents with the wrong shape; a $jsonSchema validator lists the required fields, each field's type, a minimum and the values allowed, createCollection or collMod attaches it, the error names the rule a document broke, and validationLevel and validationAction decide what is checked and what happens.

By

Updated

Cheat sheet: Schema Validation with $jsonSchema
Category
MongoDB
Level
Journeyman
Tags
$jsonSchema, collMod, mongodb, Schema Validation, validationLevel and validationAction