MCPInstall

mongodb-usage

This skill should be used when user asks to "query MongoDB", "show database collections", "get collection schema", "list MongoDB databases", "search records in MongoDB", or "check database indexes".

Installs
47
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/fcakyon/claude-codex-settings --skill mongodb-usage
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads mongodb-usage automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

MongoDB Best Practices

MCP Limitation

This MCP operates in READ-ONLY mode. No write, update, or delete operations are possible.

Schema Design Patterns

Embedding vs Referencing

Embed when:

  • Data is accessed together frequently
  • Child documents are bounded (won't grow unbounded)
  • One-to-few relationships
  • Data doesn't change frequently

Reference when:

  • Data is accessed independently
  • Many-to-many relationships
  • Documents would exceed 16MB limit
  • Frequent updates to referenced data

Common Patterns

Subset pattern: Store frequently accessed subset in parent, full data in separate collection.

Bucket pattern: Group time-series data into buckets (e.g., hourly readings in one document).

Computed pattern: Store pre-computed values for expensive calculations.

Index Strategies

Index Guidelines

  • Index fields used in queries, sorts, and aggregation $match stages
  • Compound indexes support queries on prefix fields
  • Covered queries (all fields in index) are fastest
  • Too many indexes slow writes

Index Types

  • Single field: Basic index on one field
  • Compound: Multiple fields, order matters for queries
  • Multikey: Automatically created for array fields
  • Text: Full-text search on string content
  • TTL: Auto-expire documents after time period

ESR Rule

For compound indexes, order fields by:

  1. Equality (exact match fields)
  2. Sort (sort order fields)
  3. Range (range query fields like $gt, $lt)

Aggregation Pipeline

Performance Tips

  • Put $match and $project early to reduce documents
  • Use $limit early when possible
  • Avoid $lookup on large collections without indexes
  • Use $facet for multiple aggregations in one query

Common Stages

// Filter documents
{ $match: { status: "active" } }

// Reshape documents
{ $project: { name: 1, total: { $sum: "$items.price" } } }

// Group and aggregate
{ $group: { _id: "$category", count: { $sum: 1 } } }

// Sort results
{ $sort: { count: -1 } }

// Join collections
{ $lookup: { from: "orders", localField: "_id", foreignField: "userId", as: "orders" } }

Connection Best Practices

Connection String Formats

  • Atlas: mongodb+srv://user:pass@cluster.mongodb.net/database
  • Local: mongodb://localhost:27017/database
  • Replica set: mongodb://host1,host2,host3/database?replicaSet=rs0

Connection Pooling

  • Use connection pooling in applications (default in drivers)
  • Set appropriate pool size for your workload
  • Don't create new connections per request

Anti-Patterns to Avoid

  • Unbounded arrays: Arrays that grow without limit
  • Massive documents: Documents approaching 16MB
  • Too many collections: Use embedding instead
  • Missing indexes: Queries doing collection scans
  • $where operator: Use aggregation instead for security
  • Storing files in documents: Use GridFS for large files

FAQ

What does the mongodb-usage skill do?

This skill should be used when user asks to "query MongoDB", "show database collections", "get collection schema", "list MongoDB databases", "search records in MongoDB", or "check database indexes".

How do I install mongodb-usage?

Run npx skills add https://github.com/fcakyon/claude-codex-settings --skill mongodb-usage in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/mongodb-usage/ (personal) or .claude/skills/mongodb-usage/ (project).

Which AI agents can use mongodb-usage?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is mongodb-usage safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains mongodb-usage?

It is published by fcakyon in fcakyon/claude-codex-settings. It has 47 recorded installs.

More from fcakyon/claude-codex-settings

View all →

tavily-usage

fcakyon/claude-codex-settings

This skill should be used when user asks to "search the web", "fetch content from URL", "extract page content", "use Tavily search", "scrape this website", "get information from this link", or "web search for X".

anthropic-frontend-design

fcakyon/claude-codex-settings

Open the skill to read its SKILL.md instructions.

Frontend & Design230 installs

paper-search-usage

fcakyon/claude-codex-settings

This skill should be used when the user asks to "search for papers", "find research papers", "search arXiv", "search PubMed", "look up a DOI", "download a paper", "search IEEE", or "search Scopus".

agent-browser

fcakyon/claude-codex-settings

Open the skill to read its SKILL.md instructions.

openai-frontend-design

fcakyon/claude-codex-settings

Use for new frontend applications, dashboards, games, creative websites, hero sections, and visually driven UI from scratch, or when the user explicitly asks for a redesign/restyle/modernization. Builds from clean, airy, high-taste, readable image-generated concept design with section-specific references, faithful implementation, and browser testing.

Frontend & Design104 installs

setup

fcakyon/claude-codex-settings

This skill should be used when the user asks to "set up paper search", reports "paper-search command not found", wants to "replace paper search MCP", or needs help with paper search credentials.

Popular data & databases skills

View category →

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

OfficialData & Databases462.2K installs

prisma-client-api

prisma/skills

Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".

OfficialData & Databases393.5K installs

Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.

OfficialData & Databases392.3K installs

prisma-cli

prisma/skills

Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.

OfficialData & Databases390.8K installs

prisma-postgres

prisma/skills

Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.

OfficialData & Databases384.4K installs

Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.

OfficialData & Databases378.9K installs