mongodb-conventions

Identify MongoDB conventions for document modeling, BSON types, and validators.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/jsamuelsen11/claude-config --skill mongodb-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mongodb-conventions
Source: https://github.com/jsamuelsen11/claude-config/tree/main/plugins/ccfg-mongodb/skills/mongodb-conventions
Command: npx skills add https://github.com/jsamuelsen11/claude-config --skill mongodb-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establishes consistent MongoDB design principles, including document modeling, typing, validation, and safety practices to prevent schema drift and brittle queries.

Core Features & Use Cases

  • Document Modeling Rules: guidance on embed vs reference decisions, subset patterns, and denormalization strategies to balance performance and consistency.
  • BSON Type & Validator Guidelines: recommendations for ISODate usage, Decimal128 for monetary values, and strict JSON schema validators that align with MongoDB BSON types.
  • Collection & Index Design: best practices for naming, discriminator patterns, time-series considerations, and index ESR ordering.
  • Safety & Compliance: rules for backups, transaction handling, error handling, and risk mitigation to protect data integrity.

Quick Start

Review and apply the MongoDB conventions handbook to your project to enforce schema, typing, and validation standards.

Frequently Asked Questions about mongodb-conventions

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

FAQPage Schema
How do I enforce MongoDB schema validation to prevent document modeling errors?

MongoDB schema validation is enforced by configuring strict JSON schema validators that align with BSON types, preventing schema drift and brittle queries. These validators ensure consistent document modeling, typing, and data integrity across your databases.

What's the best way to structure MongoDB document models for performance and consistency?

MongoDB document modeling best practices involve strategic embed versus reference decisions, subset patterns, and denormalization. This approach balances query performance with data consistency by applying targeted conventions to collection design.

When should I use Decimal128 and ISODate in MongoDB BSON types?

Decimal128 is required for monetary values to prevent rounding errors, while ISODate usage is enforced for temporal data in MongoDB. These BSON type conventions ensure strict typing accuracy and prevent data corruption.

How do I configure MongoDB index ordering using the ESR rule?

MongoDB index ordering follows the ESR rule to optimize query performance. Applying this convention to collection design ensures indexes are structured correctly, improving query efficiency and reducing unnecessary overhead.

How do I apply the discriminator pattern in MongoDB collection design?

The discriminator pattern in MongoDB collection design allows you to handle polymorphic data structures within a single collection. This convention supports time-series considerations and structured document modeling.

What safety practices should I follow for MongoDB transactions and backups?

MongoDB safety practices require configuring transaction handling, error handling, and regular backups. These risk mitigation rules protect data integrity and ensure compliance across all database operations.