Skip to main content
skill CX Codex

mongodb-expert — Claude Code skill: what it does, install

The mongodb-expert skill covers MongoDB schema design, aggregation pipelines, indexes, replication, and production operations when database or performance work needs review.

Apache-2.0 195 installs ★ 45 updated 2026-10-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-code
Open on GitHub

What mongodb-expert does

The skill guides document modeling, CRUD work, query operators, aggregation pipelines, and index selection. It uses access patterns to frame schema decisions, including when to embed data and when to reference it. It also covers pipeline ordering, shard-key choices, and the effect of excessive indexes on writes.

Its operating guidance includes replication, sharding, connection pools, profiling, explain, backups, authentication, encryption, and network isolation. Project files can be handled with Read, Write, and Edit; database commands include mongosh, mongo, mongod, mongodump, and mongorestore. MongoDB >=7.0 is required. Further material is available in references/CORE_CONCEPTS.md.

What it helps with

  • design a document schema around access patterns
  • build an aggregation pipeline for a reporting query
  • choose indexes for filtering, sorting, or joins
  • inspect slow queries with explain
  • plan replication, sharding, or backup operations

Example prompts for the agent

  • Design a MongoDB schema for orders and explain which fields should be embedded or referenced.
  • Build an aggregation pipeline for a sales report, then place $match, $sort, and $limit with suitable indexes.
  • Review the project queries with explain, suggest indexes, and flag indexes that could slow writes.

How to install mongodb-expert

1Skills CLI (Vercel)

npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-code

2Manually: put the files in place

~/.claude/skills/mongodb-expert/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/mongodb-expert/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about mongodb-expert

How do I install mongodb-expert in Claude Code?

Run npx skills add personamanagmentlayer/pcl --skill mongodb-expert -a claude-code, then check ~/.claude/skills/mongodb-expert/SKILL.md.

What does mongodb-expert do?

It assists with MongoDB document modeling, CRUD queries, aggregation pipelines, indexes, replication, sharding, performance checks, and production operations.

Which MongoDB version does mongodb-expert require?

The skill requires MongoDB >=7.0. It can also work with mongosh, mongo, mongod, mongodump, and mongorestore.

Source text

SKILL.md · Apache-2.0
---
name: mongodb-expert
version: 1.1.0
description: >-
  Expert-level MongoDB database design, aggregation pipelines, indexing, replication, and
  production operations. Use when the user mentions NoSQL, database, aggregation, or
  performance, or when the task involves CRUD Operations, Query Operators, Aggregation
  Pipeline, or Indexing.
category: data
author: PCL Team
license: Apache-2.0
tags:
  - mongodb
  - nosql
  - database
  - aggregation
  - performance
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash(mongosh:*, mongo:*, mongod:*, mongodump:*, mongorestore:*)
  - Glob
  - Grep
requirements:
  mongodb: '>=7.0'
---

# 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

```javascript
// 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

```javascript
// 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

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

### 4. Sharding

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

### 5. Connection Pooling

```javascript
// Use connection pools
// Don't create new connections for each operation
const client = new MongoClient(uri, {
  maxPoolSize: 10,
  minPoolSize: 2,
});
```

## Approach

When working with MongoDB:

1. **Design Schema**: Consider access patterns first
2. **Index Strategically**: Cover common queries
3. **Use Aggregation**: For complex queries and transformations
4. **Monitor Performance**: Enable profiling, use explain
5. **Use Replication**: High availability and read scaling
6. **Shard When Needed**: For horizontal scaling
7. **Backup Regularly**: mongodump or filesystem snapshots
8. **Security**: Authentication, encryption, network isolation

Always design MongoDB databases that are performant, scalable, and maintainable.

## Reference Documentation

Detailed material lives alongside this skill and is read on demand:

- [Core Expertise](references/CORE_CONCEPTS.md) — CRUD Operations, Query Operators, Aggregation Pipeline, Indexing, Schema Design, Transactions, Replication, Performance Optimization

© PCL Team · Apache-2.0 · personamanagmentlayer/pcl

Similar skills

All skills for Data and databases →

From the same set104

The whole set →
react-expert react-expert configures coding agents for React 18+ and Next.js, enforcing clean TypeScript interfaces, proper hook usage, and tests with React Testing Library. CX Codex +1 200installs performance-expert performance-expert guides code profiling, database query tuning, and caching strategies to resolve latency and throughput issues. CX Codex +1 198installs javascript-expert javascript-expert — a skill that makes the assistant work as a seasoned JavaScript developer across ES2024+, Node.js and npm, so the code it writes stays in one style. CX Codex +1 197installs stockbreeder-expert stockbreeder-expert is a Claude Code skill with Python domain models and workflows for livestock records, breeding, animal health monitoring, and vaccination schedules. CX Codex +1 195installs elixir-expert elixir-expert is a Claude Code skill with Elixir, OTP, and Phoenix reference material for coding agents. It covers tasks involving a GenServer, supervision tree, or LiveView page. CX Codex +1 194installs looker-expert looker-expert — a Looker skill for the assistant: writes and reviews LookML, designs explores and measures, and catches fanout bugs before they reach a dashboard. CX Codex +1 194installs ruby-expert ruby-expert is a Claude Code skill for Ruby development, including Rails and RSpec testing. It activates for requests about Sinatra, gems, or metaprogramming. CX Codex +1 193installs code-review-expert code-review-expert conducts multi-stage code reviews targeting OWASP vulnerabilities, N+1 query bottlenecks, and overall maintainability. CX Codex +1 192installs

Project sponsors

Companies that keep this analytics open