# Mongodb Review

> Review MongoDB schemas, aggregation pipelines, indexes, and configuration for performance and production readiness

- Skill: `erp-core-dev/mongodb-review` (Agent Skill)
- Install (CLI): `npx skillmds@latest add erp-core-dev/mongodb-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/erp-core-dev/mongodb-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ERP-CORE-DEV (https://skillmd.com/u/erp-core-dev)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/erp-core-dev/mongodb-review

---


# MongoDB Review

Review MongoDB for aggregation optimization, indexing (ESR rule), sharding, schema design, and security.

## Key Checks
- explain("executionStats") on pipelines — $match/$sort early, flag COLLSCAN
- Compound indexes follow ESR: Equality first, Sort second, Range last
- Text indexes for search, wildcard for dynamic schemas, TTL for expiring docs
- Shard key: high cardinality, even distribution, present in all queries; flag jumbo chunks
- Schema: embed for 1:few read-together data, reference for unbounded arrays or independent access
- Bucket pattern for time-series, outlier pattern for large arrays
- Change streams with resume tokens, sufficient oplog size (24-48h)
- w:"majority" write concern, readConcern:"majority", retryWrites:true
- Authentication enabled, TLS enforced, no root role for app, bindIp restricted

## Output
Severity-sorted: CRITICAL, HIGH, MEDIUM, LOW, PASSED.

