mongodb

mongodb is a skill for Claude Code, Codex from Plazmodium/odin-workflow. It costs 15 tokens per session (1,027 once invoked), scanned A, original, MIT.

A set of patterns for MongoDB, a document database that stores flexible JSON-like records. It covers how to structure documents, search them, add indexes, and combine records with aggregation pipelines.

In plain words
What is it for?
Use it to design MongoDB collections, validate fields, model relationships, write CRUD queries, create indexes, and build aggregation queries.
Why use it?
It helps developers choose between embedding and linking data, enforce document rules, and keep common queries efficient.

Skill for Claude CodeCodex

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 skills/plazmodium/odin-workflow/mongodb
Any agent
npx skills add Plazmodium/odin-workflow --skill mongodb
Clone the repo
git clone --depth 1 https://github.com/Plazmodium/odin-workflow

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/plazmodium/odin-workflow/mongodb.svg)](https://agentmods.dev/skills/plazmodium/odin-workflow/mongodb)
Your own site
<a href="https://agentmods.dev/skills/plazmodium/odin-workflow/mongodb"><img src="https://agentmods.dev/badge/skills/plazmodium/odin-workflow/mongodb.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,027 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 $0.00015 $0.01027
Opus 5 $0.00008 $0.00513
Sonnet 5 $0.00003 $0.00205
Haiku 4.5 $0.00002 $0.00103

Measured 3d ago against content hash c3f0b9bac8c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mongodb 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 3d 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/skills/database/mongodb/SKILL.md · 133 lines

How it starts

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

MongoDB

Overview

MongoDB is a document database that stores data in flexible JSON-like documents. This skill covers schema design, queries, indexing, and aggregation pipelines.

Schema Design

Embedding vs Referencing

// EMBED when data is read together and has a 1:few relationship
{
  _id: ObjectId("..."),
  name: "John",
  addresses: [
    { street: "123 Main", city: "Springfield", type: "home" },
    { street: "456 Work", city: "Springfield", type: "work" }
  ]
}

// REFERENCE when data is many:many, frequently updated independently, or large
{
  _id: ObjectId("..."),
  name: "John",
  organization_id: ObjectId("...")  // Reference to organizations collection
}

Schema Validation

db.createCollection("users", {
  validator: {
    $jsonSchema: {
      bsonType: "object",
      required: ["email", "name", "createdAt"],
      properties: {
        email: { bsonType: "string", pattern: "^.+@.+$" },
        name: { bsonType: "string", maxLength: 100 },
        role: { enum: ["admin", "member", "viewer"] },
        createdAt: { bsonType: "date" }
      }
    }
  }
});

Query Patterns

CRUD

// Find with projection
const user = await db.collection('users').findOne(
  { email: "[email protected]" },
  { projection: { password_hash: 0 } }  // Exclude sensitive fields
);

// Update with operators
await db.collection('users').updateOne(
  { _id: userId },
  { $set: { name: "New Name" }, $currentDate: { updatedAt: true } }
);

// Upsert
await db.collection('metrics').updateOne(
  { date: today, type: "pageview" },
  { $inc: { count: 1 } },
  { upsert: true }
);

Aggregation Pipeline

const result = await db.collection('orders').aggregate([
  { $match: { status: "completed", createdAt: { $gte: thirtyDaysAgo } } },
  { $group: { _id: "$customerId", totalSpent: { $sum: "$total" }, orderCount: { $sum: 1 } } },
  { $sort: { totalSpent: -1 } },
  { $limit: 10 },
  { $lookup: { from: "customers", localField: "_id", foreignField: "_id", as: "customer" } },
  { $unwind: "$customer" },
  { $project: { name: "$customer.name", totalSpent: 1, orderCount: 1 } }
]).toArray();

Read the full file on GitHub · 133 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. 3d ago First seen · 133 lines · 15 tokens per session scan A c3f0b9bac8c6

Subscribe to this mod's changes

mongodb is a skill published in the GitHub repository Plazmodium/odin-workflow (0 stars, last pushed 3mo ago), licensed MIT. It adds 15 tokens to every session and 1,027 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-01.

Related

Other skills, from other repositories

b123d-modeling

Use this skill when asked to model, build, or modify a 3D part or assembly with build123d — from a text description, a technical drawing (image or PDF), dimensions in a spec, or an existing STEP/STL file.

pzfreo/build123d-mcp · 0 tokens

re-extract

Re-extract the legacy Confluence RouterOS documentation export into SQLite. Use for rebuilding the current DB pipeline, not for the manual.mikrotik.com Docusaurus migration.

tikoci/rosetta · 40 tokens

exasol-import-export

Exasol IMPORT and EXPORT SQL statements: syntax, file formats (CSV, FBV, Parquet), cloud storage (S3, Azure, GCS), connection objects, error handling, and ETL staging patterns.

exasol/mcp-server · 49 tokens

user-usecases

Database of real user use cases for APIbase platform. Contains detailed examples of how specific APIs are onboarded, wrapped, and served to AI agents. Use this skill when you need to reference real integration examples, explain the APIbase onboarding process, or design new API wrappers based on proven patterns.

whiteknightonhorse/APIbase · 63 tokens

intro-page-updater

Update the public TogoMCP intro/landing page at togomcp/data/docs/togomcp-intro.html whenever the catalog of databases, the catalog of MCP tools, or any other surface fact shown on the page changes. Trigger when the user adds/removes/renames a database (MIE file, endpoints.csv row), adds/removes/renames a tool (any…

dbcls/togomcp · 229 tokens

nextcloud-ingest

Natively ingest Nextcloud files into the epistemic-graph knowledge graph via the nextcloud-agent MCP server — fetch a file over WebDAV and store its raw bytes as a content-addressed :Blob/:AssetOccurrence plus its extracted text (pdf/office/txt or image OCR) as a linked :Document. Use when the agent must make a…

Knuckles-Team/nextcloud-agent · 122 tokens