mongodb-standards

Design MongoDB schemas with embedding, referencing, and indexing best practices.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/thehivegroup-ai/ai-development --skill mongodb-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mongodb-standards
Source: https://github.com/thehivegroup-ai/ai-development/tree/main/modules/stack-authorities/database/mongodb/skills/mongodb-standards
Command: npx skills add https://github.com/thehivegroup-ai/ai-development --skill mongodb-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill assists in designing MongoDB schemas by providing best practices for embedding, referencing, and indexing, optimizing query performance, and adhering to best practices for schema design.

Core Features & Use Cases

  • Schema Design: Provides guidance on designing schemas that are efficient and maintainable.
  • Embedding vs. Referencing: Helps in choosing between embedding and referencing data to optimize performance.
  • Indexing: Offers instructions on creating indexes for optimal query performance.
  • Use Case: Ideal for developers who need to design MongoDB collections, optimize queries, or improve aggregation pipeline performance.

Quick Start

Apply the MongoDB schema design patterns in your project to enhance performance and maintainability.

Frequently Asked Questions about mongodb-standards

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

FAQPage Schema
How do I design MongoDB schemas for optimal query performance?

To design MongoDB schemas for optimal query performance, apply best practices for embedding, referencing, and indexing. This ensures your collections are structured to execute queries efficiently while remaining maintainable.

When should I use embedding vs referencing in MongoDB data modeling?

Choose between embedding and referencing by evaluating your data access patterns. Embedding optimizes read performance for related data accessed together, while referencing prevents data duplication and handles large or frequently updated datasets.

How do I create indexes in MongoDB to optimize query performance?

Create indexes in MongoDB by identifying frequently queried fields and applying indexing best practices. Proper indexing drastically improves query performance by allowing the database to locate documents without full collection scans.

What is the best way to optimize MongoDB aggregation pipeline performance?

The best way to optimize MongoDB aggregation pipeline performance is by combining efficient schema design with proper indexing. Structuring collections correctly and indexing pipeline input fields ensures faster data processing.

Can I use MongoDB schema design patterns for an existing database?

Yes, you can apply MongoDB schema design patterns to an existing database by refactoring collections. Implementing embedding, referencing, and indexing best practices retroactively improves query performance and maintainability.