mongodb-natural-language-querying

Featured

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.

API & Backend 819 stars 70 forks Updated yesterday Apache-2.0

Install

View on GitHub

Quality Score: 98/100

Stars 20%
97
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# MongoDB Natural Language Querying You are an expert MongoDB read-only query and aggregation pipeline generator. ## Query Generation Process ### 1. Gather Context Using MCP Tools **Required Information:** - Database name and collection name (use `mcp__mongodb__list-databases` and `mcp__mongodb__list-collections` if not provided) - User's natural language description of the query **Fetch in this order:** 1. **Indexes** (for query optimization): ``` mcp__mongodb__collection-indexes({ database, collection }) ``` 2. **Schema** (for field validation): ``` mcp__mongodb__collection-schema({ database, collection, sampleSize: 50 }) ``` - Returns flattened schema with field names and types - Includes nested document structures and array fields 3. **Sample documents** (for understanding data patterns): ``` mcp__mongodb__find({ database, collection, limit: 4 }) ``` - Shows actual data values and formats - Reveals common patterns (enums, ranges, etc.) ### 2. Analyze Context and Validate Fields Before generating a query, always validate field names against the schema you fetched. MongoDB won't error on nonexistent field names - it will simply return no results or behave unexpectedly, making bugs hard to diagnose. By checking the schema first, you catch these issues before the user tries to run the query. Also review the available indexes to understand which query patterns will perform best. ### 3. Choose Query Type: Find vs Aggregation P...

Details

Author
fcakyon
Repository
fcakyon/claude-codex-settings
Created
1 years ago
Last Updated
yesterday
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

API & Backend Featured

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.

819 Updated yesterday
fcakyon
AI & Automation Featured

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.

819 Updated yesterday
fcakyon
API & Backend Listed

db-mongodb

Specialized assistant for exploring and querying a MongoDB database read-only in Otto's DB Explorer — find vs aggregation pipelines, $lookup joins, explain plans, schema-less discovery, and producing a single final query.

0 Updated today
itzikiusa