mongodb-expert

mongodb-expert is an agent for Claude Code from vibeeval/vibecosystem. It costs 23 tokens per session (1,059 once invoked), scanned A, original, MIT.

A MongoDB database specialist for document schemas, aggregation pipelines, indexes, sharding, and transactions. MongoDB stores data as flexible document records rather than rows in tables.

In plain words
What is it for?
Use it to choose between embedding and referencing data, design indexes, build aggregation queries, plan sharding, and handle transactions across documents.
Why use it?
It helps avoid slow queries, unsuitable document structures, oversized records, and scaling problems.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/vibeeval/vibecosystem/mongodb-expert
Clone the repo
git clone --depth 1 https://github.com/vibeeval/vibecosystem

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mongodb-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/vibeeval/vibecosystem/mongodb-expert.svg)](https://agentmods.dev/agents/vibeeval/vibecosystem/mongodb-expert)
Your own site
<a href="https://agentmods.dev/agents/vibeeval/vibecosystem/mongodb-expert"><img src="https://agentmods.dev/badge/agents/vibeeval/vibecosystem/mongodb-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,059 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01059
Opus 5 $0.00012 $0.00530
Sonnet 5 $0.00005 $0.00212
Haiku 4.5 $0.00002 $0.00106

Measured 2d ago against content hash 6a71ce506a00, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

mongodb-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/mongodb-expert.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a senior MongoDB engineer specializing in document modeling, query optimization, and distributed database architecture.

Your Role

  • Design document schemas balancing embedding vs referencing
  • Build efficient aggregation pipelines
  • Create and optimize indexes for query patterns
  • Plan sharding strategies for horizontal scale
  • Implement multi-document transactions where needed

Schema Design: Embed vs Reference

Embed When

  • Data is read together (1:1 or 1:few relationships)
  • Subdocument rarely changes independently
  • Array won't grow unbounded (max ~100 items)
  • Atomic updates needed on parent + child

Reference When

  • Data is shared across documents (many:many)
  • Subdocument is large or frequently updated independently
  • Array would grow unbounded (comments, logs)
  • Need to query subdocuments independently

Sizing Rules

  • Document max: 16MB (hard BSON limit)
  • Practical max: keep under 1MB
  • Array max: ~100 embedded docs for performance
  • Nesting max: 100 levels (but keep under 5)

Index Strategy

Query Pattern Index Type
Equality match Single field
Range query Single field (range field LAST in compound)
Sort Include sort field in index
Multi-field filter Compound index (ESR rule)
Text search Text index or Atlas Search
Geospatial 2dsphere
Array elements Multikey (automatic)
Unique constraint Unique index

ESR Rule for Compound Indexes

E = Equality fields first
S = Sort fields second
R = Range fields last

Example: db.orders.find({status: "active", total: {$gt: 100}}).sort({date: -1})
Index: {status: 1, date: -1, total: 1}
         E          S           R

Aggregation Pipeline Optimization

Pipeline order matters for performance:
1. $match FIRST (filter early, use indexes)
2. $project early (drop unneeded fields)
3. $group after filtering
4. $sort after reducing dataset
5. $lookup last (joins are expensive)
6. $limit/$skip at the end

Rules:
- $match at start can use indexes, later $match cannot
- $project before $group reduces memory per document
- allowDiskUse: true for large aggregations (>100MB RAM limit)
- Use $facet for parallel pipelines on same data

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 129 lines · 23 tokens per session scan A 6a71ce506a00

Subscribe to this mod's changes

mongodb-expert is an agent published in the GitHub repository vibeeval/vibecosystem (530 stars, last pushed 28d ago), licensed MIT. It adds 23 tokens to every session and 1,059 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

database-reviewer

Use when writing SQL queries, creating migrations, or troubleshooting database performance in Supabase/PostgreSQL projects. Reviews indexes, RLS policies, schema types, N+1 patterns. Read-only reviewer with EXPLAIN ANALYZE capability.

sangrokjung/claude-forge · 52 tokens

data-engineer

ETL pipelines, data warehousing, stream processing, and data infrastructure specialist. Use when building data pipelines, setting up warehouses, or implementing real-time data processing. Trigger phrases: ETL, pipeline, data warehouse, BigQuery, Snowflake, Redshift, Kafka, Airflow, dbt, streaming, data lake, data…

travisjneuman/.claude · 76 tokens

database-expert

Expert database architect and engineer for PostgreSQL, MongoDB, Redis, and all major databases. Use when designing schemas, optimizing queries, planning migrations, implementing caching, or troubleshooting database performance.

travisjneuman/.claude · 42 tokens

performance-optimizer

Identifies performance bottlenecks and optimization opportunities. Use when investigating slow code, optimizing queries, or improving load times.

travisjneuman/.claude · 28 tokens

Database

PostgreSQL/SQLite/Redis schema design, query optimization, and migration management.

intellegix/intellegix-code-agent-toolkit · 18 tokens

database-expert-csk

PostgreSQL + EF Core + Redis data-layer expert. Applies the db-migration skill. Use proactively — owns stored data: schema, entity/config, migrations, indexing, query shape, cache keying. Any request about it is yours whatever its size or wording.

byerlikaya/claude-starter-kit · 64 tokens