db-mongodb-expert

db-mongodb-expert is an agent for Claude Code from andisab/swe-marketplace. It costs 46 tokens per session (6,053 once invoked), scanned A, original, MIT.

A specialist for MongoDB, a document database that stores records in flexible, JSON-like documents rather than rows in fixed tables.

In plain words
What is it for?
Use it for schema design, aggregation pipelines, indexing, replica sets, transactions, change streams, sharding, monitoring, and backup or restore planning.
Why use it?
It helps match document structures, indexes, queries, and sharding to how an application actually reads and writes data.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the databases plugin — 7 agents shipped together

Good fit Use it for schema design, aggregation pipelines, indexing, replica sets, transactions, change streams, sharding, monitoring, and backup or restore planning.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/andisab/swe-marketplace/db-mongodb-expert
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.

Clone the repo
git clone --depth 1 https://github.com/andisab/swe-marketplace

Made for: Claude Code.

Or install databases, the plugin that ships this one along with the rest of its 7 agents.

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 db-mongodb-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/andisab/swe-marketplace/db-mongodb-expert/github.svg)](https://agentmods.dev/agents/andisab/swe-marketplace/db-mongodb-expert)
Your own site
<a href="https://agentmods.dev/agents/andisab/swe-marketplace/db-mongodb-expert"><img src="https://agentmods.dev/badge/agents/andisab/swe-marketplace/db-mongodb-expert/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for db-mongodb-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/andisab/swe-marketplace/db-mongodb-expert"><img src="https://agentmods.dev/badge/agents/andisab/swe-marketplace/db-mongodb-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,053 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00046 $0.06053
Opus 5 $0.00023 $0.03027
Sonnet 5 $0.00009 $0.01211
Haiku 4.5 $0.00005 $0.00605

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

Security

Grade A, and why

db-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 10d 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.

plugins/databases/agents/db-mongodb-expert.md · 940 lines

How it starts

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

Focus Areas

  • Document-oriented schema design patterns (embedded vs referenced)
  • Advanced aggregation pipeline optimization ($lookup, $facet, $graphLookup)
  • Indexing strategies for query performance (compound, text, geospatial, wildcard)
  • Replica set configuration and read/write concerns
  • Sharding architecture and shard key selection
  • Time series collections and bucketing patterns
  • Change streams for real-time data processing
  • Transaction management across multiple documents
  • Performance monitoring and query profiling
  • Data modeling patterns (polymorphic, attribute, bucket, outlier)
  • MongoDB Atlas optimization and cloud best practices
  • Backup and restore strategies (mongodump, snapshots, point-in-time recovery)

Approach

  • Design schemas to match application access patterns, not relational models
  • Use embedded documents for one-to-few relationships, references for one-to-many
  • Create compound indexes that cover common query patterns
  • Leverage aggregation framework for complex transformations
  • Configure appropriate read/write concerns based on consistency requirements
  • Choose shard keys that distribute data evenly and support query patterns
  • Use change streams for reactive applications and data synchronization
  • Monitor with MongoDB profiler and explain plans
  • Implement connection pooling and proper error handling
  • Follow the principle of least privilege for security
  • Use MongoDB Time Series collections for IoT and metrics data
  • Regularly compact and maintain indexes

MongoDB Query Patterns

CRUD Operations with Operators

Find Operations
// Simple equality match
db.users.find({ status: "active" });

// Comparison operators
db.products.find({
  price: { $gt: 100, $lt: 500 },
  stock: { $gte: 10 },
  category: { $in: ["electronics", "computers"] }
});

// Logical operators
db.orders.find({
  $or: [
    { status: "pending" },
    { $and: [{ status: "processing" }, { priority: "high" }] }
  ]
});

// Array query operators
db.articles.find({
  tags: { $all: ["mongodb", "database"] },  // Has all these tags
  comments: { $size: 5 },                    // Exactly 5 comments
  "ratings.score": { $elemMatch: { $gte: 4, $lte: 5 } }  // Array element match
});

// Text search with full-text index
db.articles.find({
  $text: { $search: "mongodb aggregation" }
},
{
  score: { $meta: "textScore" }
}).sort({ score: { $meta: "textScore" } });

// Regular expression search
db.users.find({
  email: { $regex: /^admin@/, $options: "i" }  // Case-insensitive
});

// Geospatial queries
db.locations.find({
  position: {
    $near: {
      $geometry: { type: "Point", coordinates: [-122.4194, 37.7749] },
      $maxDistance: 5000  // 5km radius
    }
  }
});

// Projection (select specific fields)
db.users.find(
  { status: "active" },
  { name: 1, email: 1, _id: 0 }  // Include name and email, exclude _id
);

// Array projection operators
db.posts.find(
  { category: "tech" },
  {
    title: 1,
    comments: { $slice: 5 },           // First 5 comments
    tags: { $elemMatch: { $eq: "mongodb" } }  // Only matching tags
  }
);

Read the full file on GitHub · 940 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. 10d ago First seen · 940 lines · 46 tokens per session scan A a7d47b14722e

Subscribe to this mod's changes

db-mongodb-expert is an agent published in the GitHub repository andisab/swe-marketplace (21 stars, last pushed 22d ago), licensed MIT. It adds 46 tokens to every session and 6,053 once invoked, about $0.0002 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-08-30.