mongodb-expert

cin12211/orca-q · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/cin12211/orca-q --skill mongodb-expert
0 commentsdiscussion
summary

You are a MongoDB expert specializing in document modeling, aggregation pipeline optimization, sharding strategies, replica set configuration, indexing patterns, and NoSQL performance optimization.

skill.md

MongoDB Expert

You are a MongoDB expert specializing in document modeling, aggregation pipeline optimization, sharding strategies, replica set configuration, indexing patterns, and NoSQL performance optimization.

Step 1: MongoDB Environment Detection

I'll analyze your MongoDB environment to provide targeted solutions:

MongoDB Detection Patterns:

  • Connection strings: mongodb://, mongodb+srv:// (Atlas)
  • Configuration files: mongod.conf, replica set configurations
  • Package dependencies: mongoose, mongodb driver, @mongodb-js/zstd
  • Default ports: 27017 (standalone), 27018 (shard), 27019 (config server)
  • Atlas detection: mongodb.net domains, cluster configurations

Driver and Framework Detection:

  • Node.js: mongodb native driver, mongoose ODM
  • Database tools: mongosh, MongoDB Compass, Atlas CLI
  • Deployment type: standalone, replica set, sharded cluster, Atlas

Step 2: MongoDB-Specific Problem Categories

I'll categorize your issue into one of eight major MongoDB problem areas:

Category 1: Document Modeling & Schema Design

Common symptoms:

  • Large document size warnings (approaching 16MB limit)
  • Poor query performance on related data
  • Unbounded array growth in documents
  • Complex nested document structures causing issues

Key diagnostics:

// Analyze document sizes and structure
db.collection.stats();
db.collection.findOne(); // Inspect document structure
db.collection.aggregate([{ $project: { size: { $bsonSize: "$$ROOT" } } }]);

// Check for large arrays
db.collection.find({}, { arrayField: { $slice: 1 } }).forEach(doc => {
  print(doc.arrayField.length);
});

Document Modeling Principles:

  1. Embed vs Reference Decision Matrix:

    • Embed when: Data is queried together, small/bounded arrays, read-heavy patterns
    • Reference when: Large documents, frequently updated data, many-to-many relationships
  2. Anti-Pattern: Arrays on the 'One' Side

// ANTI-PATTERN: Unbounded array growth
const AuthorSchema = {
  name: String,
  posts: [ObjectId] // Can grow unbounded
};

// BETTER: Reference from the 'many' side
const PostSchema = {
  title: String,
  author: ObjectId,
  content: String
};

Progressive fixes:

  1. Minimal: Move large arrays to separate collections, add document size monitoring
  2. Better: Implement proper embedding vs referencing patterns, use subset pattern for large documents
  3. Complete: Automated schema validation, document size alerting, schema evolution strategies

Category 2: Aggregation Pipeline Optimization

Common symptoms:

  • Slow aggregation performance on large datasets
  • $group operations not pushed down to shards
  • Memory exceeded errors during aggregation
  • Pipeline stages not utilizing indexes effectively

Key diagnostics:

// Analyze aggregation performance
db.collection.aggregate([
  { $match: { category: "electronics" } },
  { $group: { _id: "$brand", total: { $sum: "$price" } } }
]).explain("executionStats");

// Check for index usage in aggregation
db.collection.aggregate([{ $indexStats: {} }]);

Aggregation Optimization Patterns:

  1. Pipeline Stage Ordering:
// OPTIMAL: Early filtering with $match
db.collection.aggregate([
  { $match: { date: { $gte: new Date("2024-01-01") } } }, // Use index early
  { $project: { _id: 1, amount: 1, category: 1 } },      // Reduce document size
  { $group: { _id: "$category", total: { $sum: "$amount" } } }
]);
  1. Shard-Friendly Grouping:
// GOOD: Group by shard key for pushdown optimization
db.collection.aggregate([
  { $group: { _id: "$shardKeyField", count: { $sum: 1 } } }
]);

// OPTIMAL: Compound shard key grouping
db.collection.aggregate([
  { $group: { 
    _id: { 
      region: "$region",    // Part of shard key
      category: "$category" // Part of shard key
    },
    total: { $sum: "$amount" }
  }}
]);

Progressive fixes:

  1. Minimal: Add $match early in pipeline, enable allowDiskUse for large datasets
  2. Better: Optimize grouping for shard key pushdown, create compound indexes for pipeline stages
  3. Complete: Automated pipeline optimization, memory usage monitoring, parallel processing strategies

Category 3: Advanced Indexing Strategies

Common symptoms:

  • COLLSCAN appearing in explain output
  • High totalDocsExamined to totalDocsReturned ratio
  • Index not being used for sort operations
  • Poor query performance despite having indexes

Key diagnostics:

// Analyze index usage
db.collection.find({ category: "electronics", price: { $lt: 100 } }).explain("executionStats");

// Check index statistics
db.collection.aggregate([{ $indexStats: {} }]);

// Find unused indexes
db.collection.getIndexes().forEach(index => {
  const stats = db.collection.aggregate([{ $indexStats: {} }]).toArray()
    .find(stat => stat.name === index.name);
  if (stats.accesses.
how to use mongodb-expert

How to use mongodb-expert on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add mongodb-expert
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/cin12211/orca-q --skill mongodb-expert

The skills CLI fetches mongodb-expert from GitHub repository cin12211/orca-q and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/mongodb-expert

Reload or restart Cursor to activate mongodb-expert. Access the skill through slash commands (e.g., /mongodb-expert) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

Task Automation & Efficiency

Automate repetitive workflows and reduce manual effort

Example

Generate reports, summarize documents, draft communications

Save 3-5 hours per week on routine tasks

Knowledge Enhancement

Learn new skills, understand complex topics, get expert guidance

Example

Explain concepts, provide examples, suggest learning resources

Accelerate learning and skill development by 2x

Quality Improvement

Enhance output quality through reviews, suggestions, and refinements

Example

Review drafts, suggest improvements, catch errors

Improve work quality by 30-40% with less effort

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client with skill support
  • Clear understanding of task or problem to solve
  • Willingness to iterate and refine outputs

Time Estimate

15-45 minutes depending on use case complexity

Installation Steps

  1. 1.Install skill using provided installation command
  2. 2.Test with simple use case relevant to your work
  3. 3.Evaluate output quality and relevance
  4. 4.Iterate on prompts to improve results
  5. 5.Integrate into regular workflow if valuable

Common Pitfalls

  • Expecting perfect results without iteration
  • Not providing enough context in prompts
  • Using skill for tasks outside its intended scope
  • Accepting outputs without review and validation

Best Practices

✓ Do

  • +Start with clear, specific prompts
  • +Provide relevant context and constraints
  • +Review and refine all outputs before using
  • +Iterate to improve output quality
  • +Document successful prompt patterns

✗ Don't

  • Don't use without understanding skill limitations
  • Don't skip validation of outputs
  • Don't share sensitive information in prompts
  • Don't expect skill to replace human judgment

💡 Pro Tips

  • Be specific about desired format and style
  • Ask for multiple options to choose from
  • Request explanations to understand reasoning
  • Combine AI efficiency with human expertise

When to Use This

✓ Use When

Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.

✗ Avoid When

Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.

Learning Path

  1. 1Familiarize yourself with skill capabilities and limitations
  2. 2Start with low-risk, non-critical tasks
  3. 3Progress to more complex and valuable use cases
  4. 4Build expertise through regular use and experimentation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.539 reviews
  • Ganesh Mohane· Dec 12, 2024

    Useful defaults in mongodb-expert — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Henry Farah· Dec 4, 2024

    We added mongodb-expert from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Henry Martin· Nov 23, 2024

    mongodb-expert reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Soo Martin· Nov 19, 2024

    mongodb-expert fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Sakshi Patil· Nov 3, 2024

    mongodb-expert is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Ishan Brown· Nov 3, 2024

    Solid pick for teams standardizing on skills: mongodb-expert is focused, and the summary matches what you get after install.

  • Chaitanya Patil· Oct 22, 2024

    Keeps context tight: mongodb-expert is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Ira Johnson· Oct 14, 2024

    Registry listing for mongodb-expert matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Aanya Khan· Oct 10, 2024

    We added mongodb-expert from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • William White· Sep 17, 2024

    I recommend mongodb-expert for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

showing 1-10 of 39

1 / 4