Token导航 LogoToken导航TokenDH.com
研究检索只读clawhub未标认证来源可访问clear审计通过

mongodbMongoDB 数据库

Agent Skill

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

总安装

78,836

周安装

3,318

GitHub Stars

4

下载量

27,606
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install mongodb

简介

mongodb 用于辅助 MongoDB 数据库设计、查询编写和索引优化。

  • 它能分析 schema 结构并提供一致性保障建议。
  • 使用方式包括输入集合名称和查询语句,由 Agent 返回性能分析报告。
  • 安装命令为 openclaw skills install mongodb,需确认连接字符串和只读权限。
  • 涉及写操作时应优先启用事务保护或备份机制。

SKILL.md

name
MongoDB
slug
mongodb
version
1.0.1
description
Design MongoDB schemas with proper embedding, indexing, aggregation, and production-ready patterns.
metadata
{"clawdbot":{"emoji":"🍃","requires":{"anyBins":["mongosh","mongo"]},"os":["linux","darwin","win32"]}}

When to Use

User needs MongoDB expertise — from schema design to production optimization. Agent handles document modeling, indexing strategies, aggregation pipelines, consistency patterns, and scaling.

Quick Reference

TopicFile
Schema design patternsschema.md
Index strategiesindexes.md
Aggregation pipelineaggregation.md
Production configurationproduction.md

Schema Design Philosophy

  • Embed when data is queried together and doesn't grow unboundedly
  • Reference when data is large, accessed independently, or many-to-many
  • Denormalize for read performance, accept update complexity—no JOINs means duplicate data
  • Design for your queries, not for normalized elegance

Document Size Traps

  • 16MB max per document—plan for this from day one; use GridFS for large files
  • Arrays that grow infinitely = disaster—use bucketing pattern instead
  • BSON overhead: field names repeated per document—short names save space at scale
  • Nested depth limit 100 levels—rarely hit but exists

Array Traps

  • Arrays > 1000 elements hurt performance—pagination inside documents is hard
  • $push without $slice = unbounded growth; use $push: {$each: [...], $slice: -100}
  • Multikey indexes on arrays: index entry per element—can explode index size
  • Can't have multikey index on more than one array field in compound index

$lookup Traps

  • $lookup performance degrades with collection size—no index on foreign collection (until 5.0)
  • One $lookup per pipeline stage—nested lookups get complex and slow
  • $lookup with pipeline (5.0+) can filter before joining—massive improvement
  • Consider: if you $lookup frequently, maybe embed instead

Index Strategy

  • ESR rule: Equality fields first, Sort fields next, Range fields last
  • MongoDB doesn't do efficient index intersection—single compound index often better
  • Only one text index per collection—plan carefully; use Atlas Search for complex text
  • TTL index for auto-expiration: {createdAt: 1}, {expireAfterSeconds: 86400}

Consistency Traps

  • Default read/write concern not fully consistent—{w: "majority", readConcern: "majority"} for strong
  • Multi-document transactions since 4.0—but add latency and lock overhead; design to minimize
  • Single-document operations are atomic—exploit this by embedding related data
  • retryWrites: true in connection string—handles transient failures automatically

Read Preference Traps

  • Stale reads on secondaries—replication lag can be seconds
  • nearest for lowest latency—but may read stale data
  • Write always goes to primary—read preference doesn't affect writes
  • Read your own writes: use primary or session-based causal consistency

ObjectId Traps

  • Contains timestamp: ObjectId.getTimestamp()—extract creation time without extra field
  • Roughly time-ordered—can sort by _id for creation order without createdAt
  • Not random—predictable if you know creation time; don't rely on for security tokens

Performance Mindset

  • explain("executionStats") shows actual execution—not just theoretical plan
  • totalDocsExamined vs nReturned ratio should be ~1—otherwise index missing
  • COLLSCAN in explain = full collection scan—add appropriate index
  • Covered queries: IXSCAN + totalDocsExamined: 0—all data from index

Aggregation Philosophy

  • Pipeline stages are transformations—think of data flowing through
  • Filter early ($match), project early ($project)—reduce data volume ASAP
  • $match at start can use indexes; $match after $unwind cannot
  • Test complex pipelines stage by stage—build incrementally

Common Mistakes

  • Treating MongoDB as "schemaless"—still need schema design; just enforced in app not DB
  • Not adding indexes—scans entire collection; every query pattern needs index
  • Giant documents via array pushes—hit 16MB limit or slow BSON parsing
  • Ignoring write concern—data may appear written but not persisted/replicated

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

70.09%
按下载量换算19,349

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

未展示

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills