mongodb

Optimize MongoDB schemas, queries, aggregation pipelines, and indexes.

30|7|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/rfdiosuao/openfang-cn --skill mongodb-rfdiosuao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mongodb
Source: https://github.com/rfdiosuao/openfang-cn/tree/main/crates/openfang-skills/bundled/mongodb
Command: npx skills add https://github.com/rfdiosuao/openfang-cn --skill mongodb-rfdiosuao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps users navigate the complexities of MongoDB, enabling efficient database design, optimized query performance, and effective data manipulation.

Core Features & Use Cases

  • Schema Design: Guidance on embedding vs. referencing, subset, and bucket patterns.
  • Query Optimization: Strategies for efficient querying, projections, and avoiding slow operators.
  • Aggregation Framework: Building complex data pipelines for transformations and reporting.
  • Index Management: Creating and auditing indexes for performance.
  • Use Case: Optimize a slow-running aggregation query by designing appropriate compound indexes and refining the pipeline stages for better performance.

Quick Start

Help me design a MongoDB schema for a blog application with posts, authors, and comments, prioritizing read performance for displaying posts.

Frequently Asked Questions about mongodb

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a MongoDB schema for high read performance?

MongoDB schema design for high read performance involves using embedding, referencing, subset, and bucket patterns to match your application's specific data access patterns.

What's the best way to optimize slow MongoDB aggregation queries?

Optimize slow MongoDB aggregation queries by designing appropriate compound indexes and refining pipeline stages to improve overall database performance.

How does indexing work for query optimization in MongoDB?

Indexing in MongoDB works by creating and auditing specialized indexes that support your query patterns, ensuring efficient data retrieval and database performance tuning.

When should I use embedding versus referencing in database schema design?

Use embedding versus referencing in database schema design based on your application access patterns, choosing embedding for frequently accessed related data and referencing for large or infrequently accessed data.

How do I build complex data pipelines using the MongoDB aggregation framework?

Build complex data pipelines using the MongoDB aggregation framework to perform multi-stage data transformations, generate reporting outputs, and manipulate data effectively.