mcpField
M
mongodb-migration-expert

mongodb-migration-expert

github.com/shipshitdevData & databases38183 installsUpdated 2d ago
Repository

About mongodb-migration-expert

A skill for planning safe MongoDB schema changes and migrations, aimed at developers working with evolving collections and large datasets. It emphasizes staged, backwards-compatible updates, batched backfills, and query-aligned indexes.

Key features

  1. 01Plan additive, backwards-compatible changes
  2. 02Backfill data in batches
  3. 03Design indexes around query patterns
  4. 04Keep migration scripts idempotent
  5. 05Validate index use with explain

Use cases

  1. 01Plan a forward-only schema migration
  2. 02Update collections used by multiple tenants
  3. 03Add indexes for common filters and sorts

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/shipshitdev/skills --skill mongodb-migration-expert

After installing, type/mongodb-migration-expertin Claude Code to confirm it loaded.

Bundled filesplugin.json

Details

From the project README

MongoDB Migration Expert

Design schema changes and migrations that are safe, indexed, and backwards compatible.

When to Use

  • Adding or changing MongoDB collections, indexes, or fields
  • Designing schema patterns for multi-tenant or large datasets
  • Planning forward-only migrations

Core Principles

  • Schema changes are additive first, destructive later.
  • Backfill data in batches; avoid locking large collections.
  • Indexes must match query patterns.
  • Keep migrations idempotent and observable.

Migration Workflow

  1. Add new fields with defaults or nullable values.
  2. Deploy code that handles both old and new fields.
  3. Backfill data (scripted batches).
  4. Add or adjust indexes after backfill if needed.
  5. Remove legacy fields in a later release.

Indexing

  • Add compound indexes for common filters and sorts.
  • Avoid over-indexing; each index slows writes.
  • Validate index usage with explain.

Multi-tenant Pattern (if applicable)

  • Include tenantId on documents.
  • Compound indexes should start with tenantId.

Checklist

  • Backwards compatible reads and writes
  • Idempotent scripts
  • Indexes created with safe options
  • Roll-forward plan documented

Comments

Markdown supported