Communitygithub.com

mongodb/mongodb-schema-design

MongoDB 資料庫設計模式與反模式。用於設計資料模型、審查綱要、從 SQL 遷移,或解決由綱要問題導致的效能瓶頸。

mongodb-schema-design 是什麼?

此技能涵蓋 MongoDB 綱要設計的最佳實踐與常見陷阱,包括資料模型設計、嵌入 vs 引用、以及避免無界陣列、索引爆炸等反模式。它支援設計綱要、審查現有模型、從關聯式資料庫遷移,以及最佳化時間序列、階層結構和多型資料集合。技能還涉及綱要驗證、JSON Schema、TTL 索引和資料生命週期管理,協助開發者作出明智的設計決策。無論是處理 16MB 文件大小限制、規劃歸檔策略,還是實施文件版本控制,這項技能都能提供具體的指引和可操作的建議。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-schema-design

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

mongodb-schema-design 是做什麼的?

MongoDB 綱要設計模式與反模式。用於設計資料模型、審查綱要、從 SQL 遷移,或解決由綱要問題導致的效能瓶頸。觸發關鍵字包含「設計綱要」、「嵌入 vs 引用」、「MongoDB 資料模型」、「綱要審查」、「無界陣列」、「一對多」、「樹狀結構」、「16MB 限制」、「綱要驗證」、「JSON Schema」、「時間序列」、「綱要遷移」、「多型」、「TTL」、「資料生命週期」、「歸檔」、「索引爆炸」、「不必要的索引」、「近似模式」、「文件版本控制」。

Individual skills in this repo

This repo contains 5 individual skills — each has its own dedicated page.

mongodb/mongodb-connection

Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Use this skill when working/updating/reviewing on functions that instantiate or configure a MongoDB client (eg, when calling `connect()`), configuring connection pools, troubleshooting connection errors (ECONNREFUSED, timeouts, pool exhaustion), optimizing performance issues related to connections. This includes scenarios like building serverless functions with MongoDB, creating API endpoints that use MongoDB, optimizing high-traffic MongoDB applications, creating long-running tasks and concurrency, or debugging connection-related failures.

mongodb/mongodb-mcp-setup

Guide users through configuring key MongoDB MCP server options. Use this skill when a user has the MongoDB MCP server installed but hasn't configured the required environment variables, or when they ask about connecting to MongoDB/Atlas and don't have the credentials set up.

mongodb/mongodb-natural-language-querying

Generate read-only MongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate MongoDB queries, wants to filter/query/aggregate data in MongoDB, asks "how do I query...", needs help with query syntax, or discusses finding/filtering/grouping MongoDB documents. Also use for translating SQL-like requests to MongoDB syntax. Does NOT handle Atlas Search ($search operator), vector/semantic search ($vectorSearch operator), fuzzy matching, autocomplete indexes, or relevance scoring - use search-and-ai for those. Does NOT analyze or optimize existing queries - use mongodb-query-optimizer for that. Does NOT handle aggregation pipelines that involve write operations. Requires MongoDB MCP server.

mongodb/mongodb-query-optimizer

Help with MongoDB query optimization and indexing. Use only when the user asks for optimization or performance: "How do I optimize this query?", "How do I index this?", "Why is this query slow?", "Can you fix my slow queries?", "What are the slow queries on my cluster?", etc. Do not invoke for general MongoDB query writing unless user asks for performance or index help. Prefer indexing as optimization strategy. Use MongoDB MCP when available.

mongodb/mongodb-search-and-ai

Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when users need to build search functionality for text-based queries (autocomplete, fuzzy matching, faceted search), semantic similarity (embeddings, RAG applications), or combined approaches. Also use when users need text containment, substring matching ('contains', 'includes', 'appears in'), case-insensitive or multi-field text search, or filtering across many fields with variable combinations. Provides workflows for selecting the right search type, creating indexes, constructing queries, and optimizing performance using the MongoDB MCP server.

相關技能