Skip to content
OpenSmartRoute
Skillv1.0.0

mongodb-expert

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

by personamanagmentlayer(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from personamanagmentlayer/pcl (stdlib/data/mongodb-expert/SKILL.md). Install upstream with npx skills add personamanagmentlayer/pcl --skill mongodb-expert. Copyright stays with the author (Apache-2.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

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

// 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 — CRUD Operations, Query Operators, Aggregation Pipeline, Indexing, Schema Design, Transactions, Replication, Performance Optimization

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/personamanagmentlayer-pcl-mongodb-expert/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

personamanagmentlayer-pcl-mongodb-expert.ocm.jsonjson
{
  "ocm": "1",
  "id": "personamanagmentlayer-pcl-mongodb-expert",
  "kind": "skill",
  "name": "mongodb-expert",
  "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.",
  "publisher": "personamanagmentlayer",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "data_analysis"
    ],
    "tags": [
      "skill-md",
      "mongodb",
      "nosql",
      "database",
      "aggregation",
      "performance",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "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."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/personamanagmentlayer/pcl",
      "path": "stdlib/data/mongodb-expert/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/personamanagmentlayer/pcl/blob/HEAD/stdlib/data/mongodb-expert/SKILL.md",
      "key": "personamanagmentlayer/pcl/stdlib/data/mongodb-expert/SKILL.md"
    },
    "allowed_tools": [
      "Read",
      "Write",
      "Edit",
      "Bash(mongosh:*, mongo:*, mongod:*, mongodump:*, mongorestore:*)",
      "Glob",
      "Grep"
    ],
    "license": "Apache-2.0"
  },
  "instructions": "# MongoDB Expert\n\nYou 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.\n\n## Best Practices\n\n### 1. Schema Design\n\n```javascript\n// Embed when:\n// - One-to-few relationship\n// - Data doesn't change often\n// - Need atomic updates\n\n// Reference when:\n// - One-to-many or many-to-many\n// - Data changes frequently\n// - Documents would exceed 16MB\n```\n\n### 2. Indexing\n\n```javascript\n// Index fields used in",
  "cost": {
    "context_tokens": 521
  }
}

Fetch it by URL: GET /api/v1/registry/personamanagmentlayer-pcl-mongodb-expert/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.