mongodb

mongodb is a skill for Claude Code, Codex from RightNow-AI/openfang. It costs 17 tokens per session (664 once invoked), scanned A, original, Apache-2.0.

A guide to operating MongoDB, a database that stores records as flexible documents rather than rows in tables. It covers queries, data structure, aggregation, indexes, and deployment management.

In plain words
What is it for?
Use it to design document schemas, write queries and aggregation pipelines, choose indexes, check query performance, and manage MongoDB deployments.
Why use it?
It helps avoid slow queries and poorly structured data by connecting database design to how the application reads and changes information.

Skill for Claude CodeCodex

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

About the project

OpenFang is an open-source operating system for autonomous AI agents, built in Rust to run agents that perform scheduled work such as research, monitoring, lead generation, and reporting. It is for people who want agents to operate continuously rather than only respond to prompts. The catalogue add-ons extend workflows around the OpenFang agent system.

RightNow-AI/openfang · 18,166 stars · on GitHub · openfang.sh

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/rightnow-ai/openfang/mongodb
Any agent
npx skills add RightNow-AI/openfang --skill mongodb
Clone the repo
git clone --depth 1 https://github.com/RightNow-AI/openfang

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/rightnow-ai/openfang/mongodb.svg)](https://agentmods.dev/skills/rightnow-ai/openfang/mongodb)
Your own site
<a href="https://agentmods.dev/skills/rightnow-ai/openfang/mongodb"><img src="https://agentmods.dev/badge/skills/rightnow-ai/openfang/mongodb.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 664 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.00017 $0.00664
Opus 5 $0.00009 $0.00332
Sonnet 5 $0.00003 $0.00133
Haiku 4.5 $0.00002 $0.00066

Measured 6d ago against content hash f4f2646e18f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 6d 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

  • mongodb — 100% identical, 0 lines differ
  • mongodb — 97% identical, 3 lines differ
crates/openfang-skills/bundled/mongodb/SKILL.md · 54 lines

How it starts

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

MongoDB Operations Expert

You are a MongoDB specialist. You help users design schemas, write queries, build aggregation pipelines, optimize performance with indexes, and manage MongoDB deployments.

Key Principles

  • Design schemas based on access patterns, not relational normalization. Embed data that is read together; reference data that changes independently.
  • Always create indexes to support your query patterns. Every query that runs in production should use an index.
  • Use the aggregation framework instead of client-side data processing for complex transformations.
  • Use explain("executionStats") to verify query performance before deploying to production.

Schema Design

  • Embed when: data is read together, the embedded array is bounded, and updates are infrequent.
  • Reference when: data is shared across documents, the related collection is large, or you need independent updates.
  • Use the Subset Pattern: store frequently accessed fields in the main document, move rarely-used details to a separate collection.
  • Use the Bucket Pattern for time-series data: group events into time-bucketed documents to reduce document count.
  • Include a schemaVersion field to support future migrations.

Query Patterns

  • Use projections ({ field: 1 }) to return only needed fields — reduces network transfer and memory usage.
  • Use $elemMatch for querying and projecting specific array elements.
  • Use $in for matching against a list of values. Use $exists and $type for schema variations.
  • Use $text indexes for full-text search or Atlas Search for advanced search capabilities.
  • Avoid $where and JavaScript-based operators — they are slow and cannot use indexes.

Aggregation Framework

  • Build pipelines in stages: $match (filter early), $project (shape), $group (aggregate), $sort, $limit.
  • Always place $match as early as possible in the pipeline to reduce the working set.
  • Use $lookup for left outer joins between collections, but prefer embedding for frequently joined data.
  • Use $facet for running multiple aggregation pipelines in parallel on the same input.
  • Use $merge or $out to write aggregation results to a collection for materialized views.

Read the full file on GitHub · 54 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. 6d ago First seen · 54 lines · 17 tokens per session scan A f4f2646e18f6

Subscribe to this mod's changes

mongodb is a skill published in the GitHub repository RightNow-AI/openfang (18,166 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 17 tokens to every session and 664 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-08-30.

Related

Other skills, from other repositories

feishu-bitable

飞书多维表格(Bitable)的创建、查询、编辑和管理工具。包含 27 种字段类型支持、高级筛选、批量操作和视图管理。 当以下情况时使用此 Skill: (1) 需要创建或管理飞书多维表格 App (2) 需要在多维表格中新增、查询、修改、删除记录(行数据) (3) 需要管理字段(列)、视图、数据表 (4) 用户提到"多维表格"、"bitable"、"数据表"、"记录"、"字段" (5) 需要批量导入数据或批量更新多维表格.

nexu-io/nexu · 159 tokens

mongodb-expert

Expert-level MongoDB database design, aggregation pipelines, indexing, replication, and production operations. Use when the user mentions NoSQL, database, aggregation, or performance, or when the task involves CRUD Operations, Query Operators, Aggregation Pipeline, or Indexing.

personamanagmentlayer/pcl · 56 tokens

persistence-change

Review or implement a change to datacontract, datamigrations, repo.py generation rules, ModuleContext.persistence, or persistence guidance.

BlocUnited-LLC/mozaiks · 30 tokens

后端编码

后端技术栈编码技能(规范+流程)。含 API 设计、数据库规范、错误处理、日志规范、API 端点测试要求。用于后端/全栈任务的编码阶段。.

jianchen08/Agent-os-open · 49 tokens

axiom-database-migration

Use when adding/modifying database columns, encountering "FOREIGN KEY constraint failed", "no such column", "cannot add NOT NULL column" errors, or creating schema migrations for SQLite/GRDB/SQLiteData - prevents data loss with safe migration patterns and testing workflows for iOS/macOS apps.

ComeOnOliver/skillshub · 66 tokens

mongodb

MongoDB operations expert for queries, aggregation pipelines, indexes, and schema design.

librefang/librefang-registry · 17 tokens