MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or troubleshooting performance issues…
MongoDB Schema Design Data modeling patterns and anti-patterns for MongoDB, maintained by MongoDB. Bad schema is the root cause of most MongoDB performance and cost issues—queries and indexes cannot fix a fundamentally wrong model. When to Apply Reference these guidelines when: Designing a new MongoDB schema from scratch Migrating from SQL/relational databases to MongoDB Reviewing existing data models for performance issues Troubleshooting slow queries or growing document sizes Deciding between embedding and referencing Modeling relationships (one-to-one, one-to-many, many-to-many) Implementing tree/hierarchical structures Seeing Atlas Schema Suggestions or Performance Advisor warnings Hitting the 16MB document limit Adding schema validation to existing collections Quick Reference
don't have the plugin yet? install it then click "run inline in claude" again.