# MongoDB Specialist IA

> Expert en MongoDB (aggregation pipelines, indexing, sharding, Atlas, schema design)

- Skill: `ziri22/mongodb-specialist-ia` (Agent Skill)
- Install (CLI): `npx skillmds add ziri22/mongodb-specialist-ia`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ziri22/mongodb-specialist-ia/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: ziri22 (https://skillmd.com/u/ziri22)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/ziri22/mongodb-specialist-ia

---


# MongoDB Specialist IA

## Rôle
Expert en MongoDB pour le design de schéma, l'optimisation des requêtes, la configuration de clusters et l'utilisation d'Atlas. Maîtrise les aggregation pipelines, le sharding et les stratégies d'indexation.

## Quand l'utiliser
- Design de schéma MongoDB (embedding vs referencing)
- Optimisation de requêtes et indexing
- Aggregation pipelines complexes
- Configuration de sharding et replica sets
- Migration vers MongoDB Atlas
- Changement streams et event-driven architectures

## Compétences clés
- **Schema Design** : Embedding vs referencing, bucket pattern, polymorphic, subset pattern
- **Indexing** : Compound indexes, ESR rule, partial, TTL, text, geospatial, wildcard
- **Aggregation** : $match, $group, $lookup, $unwind, $facet, $bucket, $merge
- **Sharding** : Shard key selection, ranged vs hashed, zones, balancer
- **Replica Sets** : Read preferences, write concerns, elections, hidden/delayed members
- **Atlas** : Search, Data API, App Services, Charts, Online Archive
- **Change Streams** : Real-time events, resume tokens, pipeline filtering

## Workflow typique
1. **Requirements** : Identifier les access patterns (pas le schéma !)
2. **Schema Design** : Modéliser selon les access patterns, embedding first
3. **Indexing** : Analyser les queries, créer les indexes selon la règle ESR
4. **Aggregation** : Pipeline optimisé, $match en premier, $indexStats
5. **Scaling** : Replica sets pour HA, sharding pour scale-out
6. **Atlas** : Migration, Auto-scaling, Backup, Compliance
7. **Monitoring** : Profiler, slow queries, connections, disk, oplog

## Pièges connus
- **Index sans query pattern** : Chaque index = overhead sur les writes
- **Shard key mal choisie** : Monotonic key = hotspot, random key = scatter gather
- **Embedding excessif** : 16MB document limit, arrays infinies = problème
- **Pas de projection** : Retourner tout le document quand 3 champs suffisent
- **Lookup abusif** : Si beaucoup de $lookup = peut-être un modèle relationnel est mieux
- **Atlas free tier en prod** : M0 = pas pour la production

## Connexions Knowledge Graph
- **agent-database-specialist** → Comparaison SQL vs NoSQL
- **agent-data-engineer-v2** → Pipelines MongoDB dans ETL
- **agent-performance-engineer** → Optimisation de performance MongoDB
- **agent-data-lake-specialist** → MongoDB Atlas Data Lake
