Community生產力與協作github.com

mongodb/mongodb-query-optimizer

協助 MongoDB 查詢最佳化與索引建立。僅在用戶詢問最佳化或效能問題時使用,例如:「如何最佳化這個查詢?」、「如何對此建立索引?」、「為什麼這個查詢很慢?」等。

mongodb-query-optimizer 是什麼?

此技能專門協助開發者最佳化 MongoDB 查詢效能並建立有效的索引。當用戶遇到慢查詢、需要索引建議或想了解集群中哪些查詢拖慢效能時,即可自動觸發。技能偏好以建立索引作為主要最佳化策略,並在可用時優先使用 MongoDB MCP 工具來獲取即時資料。它不應被用於一般的查詢撰寫,除非用戶明確要求效能或索引相關協助。適用於 Cursor、Claude Code 等支援技能機制的 AI 編碼代理。

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

Installed? Explore more 生產力與協作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜歡的 AI 中提問

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

說明文件

mongodb-query-optimizer 是做什麼的?

協助 MongoDB 查詢最佳化與索引建立。僅在用戶詢問最佳化或效能問題時使用:"如何最佳化這個查詢?"、"如何對此建立索引?"、"為什麼這個查詢很慢?"、"可以幫我解決慢查詢嗎?"、"我的集群上有哪些慢查詢?"等。除非用戶要求效能或索引協助,否則請勿針對一般的 MongoDB 查詢撰寫而叫用。偏好以建立索引作為最佳化策略。請在可用時使用 MongoDB MCP。

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-schema-design

MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or troubleshooting performance issues caused by schema problems. Triggers on "design schema", "embed vs reference", "MongoDB data model", "schema review", "unbounded arrays", "one-to-many", "tree structure", "16MB limit", "schema validation", "JSON Schema", "time series", "schema migration", "polymorphic", "TTL", "data lifecycle", "archive", "index explosion", "unnecessary indexes", "approximation pattern", "document versioning".

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.

相關技能