This is a comprehensive reference for MongoDB operations, covering everything from basic CRUD to complex aggregation pipelines and index strategies. You get practical examples for document queries, array operators, text search, and multi-stage aggregations with $lookup and $facet. The indexing section walks through compound, partial, TTL, and geospatial indexes with actual createIndex calls. It's built for MongoDB 7.0+ and includes mongosh access for running commands directly. The code examples are production-ready patterns, not toy demos. If you're building or optimizing Mongo applications and want expert-level guidance on aggregations or performance tuning at your fingertips, this delivers.

skills.sh installs
192
GitHub stars
44
last updated
Aug 21, 2026

Install

$ npx -y skills add personamanagmentlayer/pcl --skill mongodb-expert --agent claude-code

Installs into .claude/skills of the current project.

Files

MongoDB Expert

You are an expert in MongoDB with deep knowledge of document modeling, aggregation pipelines, indexing strategies, replication, sharding, and production operations. You design and manage performant, scalable MongoDB databases following best practices.

Best Practices

1. Schema Design

// Embed when:
// - One-to-few relationship
// - Data doesn't change often
// - Need atomic updates

// Reference when:
// - One-to-many or many-to-many
// - Data changes frequently
// - Documents would exceed 16MB

2. Indexing

// Index fields used in:
// - Queries ($match, find)
// - Sorts ($sort)
// - Joins ($lookup)

// Avoid:
// - Too many indexes (slows writes)
// - Indexes on fields with low cardinality

3. Aggregation

// Put $match early in pipeline
// Use $limit after $sort
// Use indexes with $match and $sort

4. Sharding

// Choose shard key carefully
// High cardinality
// Good distribution
// Query isolation

5. Connection Pooling

Sponsors

Details

Repository
github.com/personamanagmentlayer/pcl
Categories
Backend & APIs, Design & UI/UX, Databases
First seen
Jun 3, 2026

More from personamanagmentlayer/pcl

All 99
1vm0-ai avatarbitrixvm0-ai/vm0-skillsBitrix24 CRM API. Use when user mentions "Bitrix", "CRM", "Bitrix24 contacts", or asks about CRM management.190skills.sh installs
2vm0-ai avatarbrowserlessvm0-ai/vm0-skillsBrowserless API for headless Chrome. Use when user mentions "headless Chrome", "browserless", or needs browser automation.190skills.sh installs
3leroy-zhang avataropenclaw-setup-assistantleroy-zhang/openclaw-setup-assistantA guided, zero-friction installer and maintenance assistant for OpenClaw. Use this skill when the user wants to install OpenClaw, set up OpenClaw on a local mac189skills.sh installs
4tuziapi avatartuzi-video-gentuziapi/tuzi-skills通过兔子API进行AI视频生成。支持 Veo、Sora、Kling、Seedance 等模型,单视频和长视频(多段合成)模式。当用户要求生成视频、创建视频或需要视频生成后端时使用。189skills.sh installs
5itsmostafa avatarcognitoitsmostafa/aws-agent-skillsAWS Cognito user authentication and authorization service. Use when setting up user pools, configuring identity pools, implementing OAuth flows, managing user a188skills.sh installs
6martinholovsky avatarkanidm-expertmartinholovsky/claude-skills-generatorExpert in Kanidm modern identity management system specializing in user/group management, OAuth2/OIDC, LDAP, RADIUS, SSH key management, WebAuthn, and MFA. Deep188skills.sh installs