MongoDB OdditiesSchema Flexibility & Its Consequences
All courses

Schemaless ≠ schema-free

Any field shape can coexist in one collection. Freedom! Until you query age: { $gt: 25 } and Bob's age is the string "thirty".

Use $type filters, schema validation, or application-level discipline. Pick at least one before production.

Output
Press Run to execute your code.