
Mongodb Schema Design
mongodb/agent-skillsOfficial
Schema design patterns and anti-patterns for MongoDB, covering when to embed versus reference data.
- skills.sh installs
- 7.4K
- GitHub stars
- 207
- last updated
- Aug 21, 2026
What it does
- Covers antipatterns (unnecessary collections, excessive $lookup, unnecessary indexes), fundamentals (embed vs reference, document model, validation, 16MB size), and 11 design patterns
- Includes an access pattern analysis workflow that combines query stats, slow query logs, codebase review, and user input before recommending changes
- Enforces a principle that data accessed together should be stored together, reserving references for cases where embedding is not viable
- Designed for developers designing new MongoDB data models, migrating from SQL, or troubleshooting schema-driven performance issues
Install
$ npx -y skills add mongodb/agent-skills --skill mongodb-schema-design -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
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
1. Schema Anti-Patterns - 3 rules
Details
- Repository
- github.com/mongodb/agent-skills
- Category
- Databases
- First seen
- May 16, 2026
More from mongodb/agent-skills
All 8Similar to Mongodb Schema Design
More Databases
nosql-database-designaj-geddes/useful-ai-prompts493 installsSchema design guidance for MongoDB and DynamoDB covering document modeling, indexing, and query-driven denormalization.
mongodbbobmatnyc/claude-mpm-skills354 installsDocument-oriented NoSQL guide covering flexible schema design, query patterns, and aggregation with indexing.
database-management-patternsmanutej/luxor-claude-marketplace467 installsComprehensive PostgreSQL and MongoDB guide covering schema design, indexing, transactions, replication, and tuning.
mongodb-connectionmongodb/agent-skills5.7K installsOptimize MongoDB client connection pools, timeouts, and patterns across supported driver languages with context-first guidance.
mongoose-mongodbpluginagentmarketplace/custom-plugin-nodejs702 installsGuide to MongoDB in Node.js with Mongoose for schemas, CRUD, relationships, and aggregation queries.