Token导航 LogoToken导航

Agent Skill · 研究检索

mongodb(MongoDB 数据库)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

mongodb 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 50,810。

总安装 606周安装 25GitHub Stars 12下载 198核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mongodb(MongoDB 数据库)
来源仓库:https://github.com/claude-dev-suite/claude-dev-suite
仓库路径:skills/mongodb
安装命令:
npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill mongodb
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill mongodb

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

mongodb 用于辅助数据库表结构、查询语句和数据维护任务,适合分析 schema 和编写聚合操作。它提供 CRUD 操作示例、索引优化和事务处理模式,支持复杂的数据分析和报表需求。使用时需明确连接环境和目标集合,区分只读分析与写入变更;涉及批量删除时应优先事务保护。

安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。mongodb 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/mongodb

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill mong…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

mongodb 怎么安装?

在终端执行 npx skills add https://github.com/claude-dev-suite/claude-dev-suite --skill mongodb。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

mongodb 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

mongodb 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

mongodb 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

mongodb 用的人多吗?

公开数据是累计安装 606 次,近一周安装 25 次,下载 198 次,GitHub 12 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

mongodb 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
mongodb

MongoDB 数据库 · 本页

60612调用外部服务未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

MongoDB Core Knowledge

Deep Knowledge: Use mcp__documentation__fetch_docs with technology: mongodb for comprehensive documentation.

CRUD Operations

// Create
db.users.insertOne({
  name: "John",
  email: "john@example.com",
  createdAt: new Date()
});

// Read
db.users.find({ isActive: true })
  .sort({ createdAt: -1 })
  .limit(20);

db.users.findOne({ _id: ObjectId("...") });

// Update
db.users.updateOne(
  { _id: ObjectId("...") },
  { $set: { name: "Jane" } }
);

// Delete
db.users.deleteOne({ _id: ObjectId("...") });

Query Operators

// Comparison
{ age: { $gt: 18, $lt: 65 } }
{ status: { $in: ["active", "pending"] } }

// Logical
{ $and: [{ age: { $gt: 18 } }, { isActive: true }] }
{ $or: [{ status: "admin" }, { role: "moderator" }] }

// Array
{ tags: { $all: ["tech", "news"] } }
{ "scores.0": { $gt: 90 } }

Aggregation Pipeline

db.orders.aggregate([
  { $match: { status: "completed" } },
  { $group: {
      _id: "$userId",
      totalSpent: { $sum: "$amount" },
      orderCount: { $count: {} }
  }},
  { $sort: { totalSpent: -1 } },
  { $limit: 10 }
]);

Indexes

db.users.createIndex({ email: 1 }, { unique: true });
db.users.createIndex({ createdAt: -1 });
db.users.createIndex({ name: "text" }); // Text search

Production Readiness

Security Configuration

// Enable authentication (mongod.conf)
// security:
//   authorization: enabled

// Create admin user
use admin
db.createUser({
  user: "admin",
  pwd: "secure_password",
  roles: ["root"]
});

// Create application user with limited privileges
use mydb
db.createUser({
  user: "app_user",
  pwd: "app_password",
  roles: [
    { role: "readWrite", db: "mydb" }
  ]
});

// Create read-only user for reporting
db.createUser({
  user: "reporter",
  pwd: "reporter_password",
  roles: [{ role: "read", db: "mydb" }]
});
# mongod.conf - Security settings
security:
  authorization: enabled

net:
  ssl:
    mode: requireSSL
    PEMKeyFile: /path/to/mongodb.pem
    CAFile: /path/to/ca.pem

Connection with SSL

// Node.js connection with SSL
const { MongoClient } = require('mongodb');

const client = new MongoClient('mongodb://host:27017', {
  ssl: true,
  sslCA: fs.readFileSync('/path/to/ca.pem'),
  sslCert: fs.readFileSync('/path/to/client.pem'),
  sslKey: fs.readFileSync('/path/to/client.key'),
  authSource: 'admin',
});

Replica Set (High Availability)

// Initialize replica set
rs.initiate({
  _id: "myReplicaSet",
  members: [
    { _id: 0, host: "mongo1:27017", priority: 2 },
    { _id: 1, host: "mongo2:27017", priority: 1 },
    { _id: 2, host: "mongo3:27017", priority: 1 }
  ]
});

// Connection string for replica set
mongodb://mongo1:27017,mongo2:27017,mongo3:27017/mydb?replicaSet=myReplicaSet&readPreference=secondaryPreferred

Backup & Recovery

# mongodump backup
mongodump --uri="mongodb://user:pass@host:27017/mydb" \
  --out=/backup/$(date +%Y%m%d) \
  --gzip

# mongorestore
mongorestore --uri="mongodb://user:pass@host:27017/mydb" \
  --gzip /backup/20240115

# Continuous backup with oplog
mongodump --oplog --out=/backup/full

# Point-in-time recovery
mongorestore --oplogReplay --oplogLimit=1705315200 /backup/full

Performance Tuning

// Index best practices
db.collection.createIndex({ field: 1 }, { background: true });

// Compound indexes for common queries
db.orders.createIndex({ userId: 1, createdAt: -1 });

// TTL index for automatic expiration
db.sessions.createIndex({ createdAt: 1 }, { expireAfterSeconds: 3600 });

// Partial indexes for filtered queries
db.orders.createIndex(
  { status: 1 },
  { partialFilterExpression: { status: { $in: ["pending", "processing"] } } }
);

// Analyze query performance
db.orders.find({ userId: "123" }).explain("executionStats");

Monitoring Metrics

MetricAlert Threshold
Connection count> 80% max
Replication lag> 10 seconds
Query targeting> 1000 docs examined/returned
Cache hit ratio< 95%
Oplog window< 24 hours
Disk usage> 80%

Monitoring Commands

// Server status
db.serverStatus();

// Current operations
db.currentOp({ "active": true, "secs_running": { "$gt": 5 } });

// Replication status
rs.status();

// Index usage stats
db.collection.aggregate([{ $indexStats: {} }]);

// Collection stats
db.collection.stats();

// Database profiler (slow queries)
db.setProfilingLevel(1, { slowms: 100 });
db.system.profile.find().sort({ ts: -1 }).limit(10);

Read/Write Concerns

// Write concern for durability
db.orders.insertOne(order, {
  writeConcern: { w: "majority", j: true, wtimeout: 5000 }
});

// Read concern for consistency
db.orders.find({ userId: "123" }).readConcern("majority");

// Read preference for scaling reads
db.orders.find().readPref("secondaryPreferred");

Sharding (Horizontal Scaling)

// Enable sharding on database
sh.enableSharding("mydb");

// Shard collection with hashed key
sh.shardCollection("mydb.orders", { _id: "hashed" });

// Shard collection with range key
sh.shardCollection("mydb.logs", { timestamp: 1 });

// Check sharding status
sh.status();

Checklist

  • Authentication enabled
  • TLS/SSL encryption enabled
  • Least-privilege user accounts
  • Replica set configured (3+ nodes)
  • Regular mongodump backups
  • Oplog size adequate for recovery window
  • Indexes on query fields
  • Query profiler enabled (slow queries)
  • Write concern: majority + journal
  • Connection pooling configured
  • Monitoring alerts configured
  • Sharding (if > 100GB or high throughput)

When NOT to Use This Skill

  • Relational data with complex joins - Use postgresql or mysql for relational databases
  • Transactions across multiple tables - Use SQL databases with ACID guarantees
  • Full-text search - Use elasticsearch for advanced search features
  • Caching - Use redis for in-memory caching
  • Graph relationships - Consider Neo4j or graph databases

Anti-Patterns

Anti-PatternIssueSolution
Unbounded array growthDocument size limit (16MB), performance degradationUse separate collection or capped arrays
Missing indexes on queriesCollection scans, slow performanceCreate indexes on query fields
Using $lookup excessivelyPoor performance, not optimized for joinsDenormalize data or redesign schema
Storing large binary dataExceeds 16MB limit, slow queriesUse GridFS for files > 16MB
Not using projectionTransfers unnecessary dataSpecify needed fields in projection
Ignoring write concernData loss riskUse majority write concern for important data
Not using read preferenceOverloading primaryUse secondary reads for analytics
Massive embedded documentsHard to query, update complexitySplit into separate collections
Not handling connection poolingConnection exhaustionConfigure proper pool size
Using count() on large collectionsSlow, scans collectionUse countDocuments() or estimatedDocumentCount()

Quick Troubleshooting

ProblemDiagnosticFix
Slow queriesdb.collection.explain("executionStats")Add indexes, check query pattern
High memory usagedb.serverStatus().memIncrease RAM, optimize indexes
Connection pool exhaustedCheck connection countIncrease pool size, fix connection leaks
Replication lagrs.status() and check optimeDateIncrease resources, tune oplog size
Disk space fulldb.stats()Compact collections, increase storage
Index not being usedexplain() shows COLLSCANVerify index exists, check query shape
Write conflictsCheck error logs for writeConflictRetry logic, reduce concurrent updates
Document too largeError: "document is larger than 16MB"Use GridFS or split document

Reference Documentation

平台分布

Codex

33.67%
按下载量换算67

Claude

31.1%
按下载量换算62

Cursor

18.66%
按下载量换算37

Gemini CLI

8.77%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills