mongodb
Skill15 starsChanged 42 days agoMITView on GitHub
Expert MongoDB document database assistance covering aggregation pipelines, compound indexes, replica sets, and sharding. Use when designing flexible JSON schemas, querying geospatial data, or scaling document stores.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- hoodini/ai-agents-skillstheir own version, first seen Oct 25, 2026
- zeeshanalimughal/claude-skillstheir own version, first seen Oct 13, 2026
- Makiya1202/awesome-codex-computer-usetheir own version, first seen Oct 11, 2026
- kid-sid/claude-spellbooktheir own version, first seen Oct 9, 2026
- fworks-tech/agenthoodtheir own version, first seen Sep 28, 2026
- muxammadmamajonov/dot-claudetheir own version, first seen Jul 6, 2026
Used with
Projects with it also use performance, security and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
klauswgSkillperformance
Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".
Also in 3 projects that use this
0xSeroSkillsecurity
Also in 3 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
NVIDIASkilltesting
Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.
Also in 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- hoodini/ai-agents-skills★ 295same name
- kid-sid/claude-spellbook★ 190same name
- fworks-tech/agenthood★ 3same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- Makiya1202/ai-agents-skills★ 2same name
- Makiya1202/awesome-codex-computer-use★ 2same name
- Sorcha-Platform/Sorcha★ 2same name
- FullFran/Agent-skills-POC★ 1same name
- anurag-azure/skills★ 0same name
- muxammadmamajonov/dot-claude★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 94
Use $lookup with $project and pagination $facet:
- Distinctive: line 128
Follow the ESR Rule for Indexes: Order compound indexes by Equality first, Sort second, and Range last.
- Very specific: line 130
Use Bulk Operations: Batch multiple write operations using bulkWrite() to minimize network roundtrips.
- Distinctive: line 134
Create unbounded arrays inside documents: Unbounded arrays degrade performance and can hit the 16MB document size limit.
- Very specific: line 135
Use $lookup excessively: MongoDB is not a relational database.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MongoDB
MongoDB is a document database. It stores data in JSON-like documents (BSON). It is the most popular NoSQL database, known for flexibility and scalability.
When to Use
- Flexible JSON Document Storage: Modeling evolving, nested domain entities with polymorphic schemas in BSON.
- High-Velocity Operational Data Stores: Content management, e-commerce product catalogs, and user personalization platforms.
- Rich Aggregation Pipelines: Transforming, joining ($lookup), grouping, and projecting analytical data streams in real time.
- Global Sharding & Geospatial Indexing: Scaling collections horizontally across shards and executing 2dsphere geo queries.
Quick Start
// Using Mongoose (Node.js)
const kittySchema = new mongoose.Schema({
name: String,
});
const Kitten = mongoose.model("Kitten", kittySchema);
const silence = new Kitten({ name: "Silence" });
await silence.save();Core Concepts
BSON Documents & Schema Flexibility
Data is stored as binary JSON (BSON), supporting native dates, 64-bit integers, decimals, and geospatial points:
// MongoDB Document in collections/orders
{
"_id": ObjectId("66f6ab42d1e1c3a628a58a98"),
"orderNumber": "ORD-2026-901",
"customer": { "id": "cust_12", "email": "alex@example.com" },
"items": [
{ "sku": "WIDGET-01", "qty": 2, "price": 49.99 }
],
"shippingAddress": {
"type": "Point",
"coordinates": [-73.9851, 40.7488] // 2dsphere GeoJSON
},
"status": "PROCESSING",
"createdAt": ISODate("2026-09-27T10:00:00Z")
}Powerful Multi-Stage Aggregation Framework
Transforms and aggregates documents through sequential pipeline stages:
db.orders.aggregate([
{
$match: { status: "COMPLETED", createdAt: { $gte: ISODate("2026-01-01") } },
},
{ $unwind: "$items" },
{
$group: {
_id: "$items.sku",
totalRevenue: { $sum: { $multiply: ["$items.qty", "$items.price"] } },
unitsSold: { $sum: "$items.qty" },
},
},
{ $sort: { totalRevenue: -1 } },
{ $limit: 5 },
]);Replica Sets & Automated Failover
Ensures high availability through 3-node primary-secondary elections:
[ Primary (Read/Write) ] ──Oplog Replication (Async)──→ [ Secondary (Read Replicas) ]
│
▼
[ Secondary (Voter) ]Common Patterns
Aggregation Pipeline with Lookup and Facets
Problem: Normalizing and joining related documents across collections efficiently in a single query.
Solution:
Use $lookup with $project and pagination $facet:
db.orders.aggregate([
{
$match: { status: "DELIVERED", createdAt: { $gte: ISODate("2025-01-01") } },
},
{
$lookup: {
from: "users",
localField: "userId",
foreignField: "_id",
as: "customer",
},
},
{ $unwind: "$customer" },
{
$project: {
orderId: "$_id",
totalAmount: 1,
customerName: "$customer.name",
customerEmail: "$customer.email",
},
},
{ $sort: { totalAmount: -1 } },
{ $limit: 20 },
]);Best Practices
Do:
- Design for Data Access Patterns: Embed data that is read together frequently; reference data when unbounded growth is expected.
- Follow the ESR Rule for Indexes: Order compound indexes by Equality first, Sort second, and Range last.
- Enable JSON Schema Validation: Enforce required fields and types at the collection level via
$jsonSchema. - Use Bulk Operations: Batch multiple write operations using
bulkWrite()to minimize network roundtrips.
Don't:
- Create unbounded arrays inside documents: Unbounded arrays degrade performance and can hit the 16MB document size limit.
- Use
$lookupexcessively: MongoDB is not a relational database; heavy multi-collection joins destroy throughput. - Perform unindexed queries: Run
.explain("executionStats")to verify queries utilizeIXSCANrather thanCOLLSCAN.
Troubleshooting
| Error | Cause | Solution |
Executor error during find command: OperationExceededTimeLimit | Query performing full collection scan (COLLSCAN) without supporting index. | Run explain('executionStats') and add compound index matching filter and sort keys. |
WriteConflict error | Concurrent updates modifying same document concurrently in WiredTiger. | Implement retry logic in application layer or batch modifications. |
BSONObj size exceeds maximum allowed size (16MB) | Single document exceeded 16MB limit due to unbounded arrays. | Refactor schema: move unbounded child arrays into separate collection with parent references. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

