What problem does it solve? MongoDB applications often suffer from slow queries, unbounded document growth, exhausted connection pools, and poorly chosen shard keys. This Skill provides a structured diagnostic workflow that detects your MongoDB environment, categorizes the issue into one of eight problem areas, and applies progressive fixes with concrete code examples. ## Core Features & Use Cases - Document Modeling & Schema Design: Apply embed-vs-reference decisions, attribute, bucket, computed, and subset patterns while staying under the 16MB document limit. - Performance Optimization: Optimize aggregation pipelines with early $match stages, design compound indexes following the ESR rule, and build covered queries. - Cluster Operations: Configure connection pools, select high-cardinality shard keys, tune replica set read preferences, and handle transactions with retry logic. - Use Case: Your aggregation pipeline times out on a sharded cluster. The Skill profiles the pipeline with explain("executionStats"), reorders stages for index usage, and rewrites the $group to leverage shard key pushdown. ## Quick Start Ask the assistant to analyze why your MongoDB query is slow and to recommend indexes and pipeline optimizations for your collection.