mongodb-guide

mongodb-guide is a skill for Claude Code, Codex from khalilbenaz/claude-skills-collection. It costs 52 tokens per session (2,135 once invoked), scanned A, original, MIT.

A guide to designing MongoDB document models and writing queries for a document-based database. It covers when to embed related data and when to link it.

In plain words
What is it for?
Use it to plan MongoDB collections, choose between embedded and referenced documents, and apply patterns for reviews, totals, time-series data, and unusual records.
Why use it?
It helps avoid schemas that become too large, slow, or difficult to update by starting with the application's real access patterns.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to plan MongoDB collections, choose between embedded and referenced documents, and apply patterns for reviews, totals, time-series data, and unusual records.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khalilbenaz/claude-skills-collection/mongodb-guide
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.

Any agent
npx skills add khalilbenaz/claude-skills-collection --skill mongodb-guide
Clone the repo
git clone --depth 1 https://github.com/khalilbenaz/claude-skills-collection

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-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/mongodb-guide/github.svg)](https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/mongodb-guide)
Your own site
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/mongodb-guide"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/mongodb-guide/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 mongodb-guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/mongodb-guide"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/mongodb-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,135 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00052 $0.02135
Opus 5 $0.00026 $0.01068
Sonnet 5 $0.00010 $0.00427
Haiku 4.5 $0.00005 $0.00214

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

Security

Grade A, and why

mongodb-guide 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 9d 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.

database-skills/mongodb-guide/SKILL.md · 203 lines

How it starts

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

MongoDB Guide

Workflow

1. Analyser les patterns d'accès

Avant tout schéma, lister les requêtes réelles : quelles entités sont lues ensemble ? À quelle fréquence ? Ratio lecture/écriture ?

Critères de décision embed vs reference :

Critère Embed Reference
Données toujours lues ensemble
Taille du tableau bornée (<100 éléments)
Données partagées entre plusieurs parents
Mise à jour fréquente de sous-documents
Document proche de 16 Mo

2. Concevoir le schéma

Patterns courants :

  • Subset : n'embarquer que les N derniers éléments (ex. 10 derniers avis)
  • Computed : stocker un agrégat précalculé (total, moyenne) mis à jour à l'écriture
  • Bucket : regrouper des séries temporelles par période (ex. mesures IoT par heure)
  • Extended Reference : dupliquer les champs les plus lus du document référencé
  • Outlier : gérer les documents « hors-norme » via un flag + collection overflow

Exemple schéma Computed (compteur dénormalisé) :

// À l'écriture d'un avis :
db.products.updateOne(
  { _id: productId },
  {
    $push: { latestReviews: { $each: [review], $slice: -10 } },
    $inc: { reviewCount: 1, ratingSum: review.rating }
  }
)
// reviewCount et ratingSum toujours à jour, aucun $lookup nécessaire

3. Construire les aggregation pipelines

Règles d'ordre obligatoires :

  1. $match le plus tôt possible (utilise les index)
  2. $project / $unset pour réduire la taille des documents en transit
  3. $sort + $limit avant $lookup pour limiter les jointures
db.orders.aggregate([
  { $match: { status: "shipped", createdAt: { $gte: ISODate("2026-01-01") } } },
  { $project: { customerId: 1, totalAmount: 1, _id: 0 } },
  { $group: { _id: "$customerId", totalSpent: { $sum: "$totalAmount" } } },
  { $sort: { totalSpent: -1 } },
  { $limit: 20 },
  { $lookup: {
      from: "customers",
      localField: "_id",
      foreignField: "_id",
      as: "customer",
      pipeline: [{ $project: { name: 1, email: 1 } }]
  }},
  { $unwind: "$customer" }
])

Read the full file on GitHub · 203 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. 9d ago First seen · 203 lines · 52 tokens per session scan A 625bfe4b52c9

Subscribe to this mod's changes

mongodb-guide is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (22 stars, last pushed 19d ago), licensed MIT. It adds 52 tokens to every session and 2,135 once invoked, about $0.0003 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 skills, from other repositories