Community生产力与协作github.com

mongodb/mongodb-natural-language-querying

使用自然语言生成只读的 MongoDB 查询或聚合管道,并附带集合模式上下文和示例文档。

mongodb-natural-language-querying 是什么?

该技能允许开发者和 AI 代理通过自然语言描述来生成 MongoDB 的只读查询(find)或聚合管道。它利用集合的模式信息和示例文档作为上下文,自动将用户的请求(如“按条件过滤”、“分组统计”或“类似 SQL 的查询”)转换为准确的 MongoDB 语法。此技能主要用于数据检索场景,可显著提升编写查询的效率。它支持多种 AI 代理平台(如 Claude Code、Cursor 等),但需要依赖 MongoDB MCP 服务器来获取集合元数据。需要注意的是,该技能不处理涉及 Atlas Search、向量搜索、模糊匹配或写入操作的聚合管道,对于查询优化和性能分析应使用专门的优化器技能。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mongodb/agent-skills/tree/main/skills/mongodb-natural-language-querying

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

mongodb-natural-language-querying 是做什么的?

使用自然语言生成只读的 MongoDB 查询(find)或聚合管道,并附带集合模式上下文和示例文档。当用户要求编写、创建或生成 MongoDB 查询,希望过滤/查询/聚合 MongoDB 中的数据,询问“如何查询……”,需要查询语法帮助,或讨论查找/过滤/分组 MongoDB 文档时,请使用此技能。同时适用于将类似 SQL 的请求转换为 MongoDB 语法。不处理 Atlas 搜索($search 操作符)、向量/语义搜索($vectorSearch 操作符)、模糊匹配、自动补全索引或相关性评分——这些请使用 search-and-ai 技能。不分析或优化现有查询——请使用 mongodb-query-optimizer 技能。不处理涉及写入操作的聚合管道。需要 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-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-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.

相关技能