home / skills / partme-ai / full-stack-skills / mongodb
This skill helps you work with MongoDB by guiding document operations, queries, aggregation, indexes, and best practices for scalable data design.
npx playbooks add skill partme-ai/full-stack-skills --skill mongodbReview the files below or copy the command above to add this skill to your agents.
---
name: mongodb
description: Provides comprehensive guidance for MongoDB database including document operations, queries, aggregation, indexes, and best practices. Use when the user asks about MongoDB, needs to work with MongoDB collections, write queries, or design MongoDB schemas.
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]
## How to use this skill
[待完善:根据具体工具添加使用指南]
## Best Practices
[待完善:根据具体工具添加最佳实践]
## Keywords
[待完善:根据具体工具添加关键词]
This skill provides practical, hands-on guidance for working with MongoDB, covering document operations, queries, aggregation pipelines, index design, and schema modeling. It helps developers write efficient queries, design collections, and apply best practices for performance and scalability. Use it when you need actionable examples, troubleshooting tips, or recommendations for production-ready MongoDB usage.
The skill inspects the user's intent and returns concrete MongoDB examples, shell/driver commands, and design advice tailored to their problem. It can generate CRUD operations in the Mongo shell and common drivers (Python/PyMongo, Node.js), craft aggregation pipelines, suggest index strategies, and recommend schema patterns. For performance issues it analyzes query shape and suggests indexes or pipeline rewrites.
Should I embed or reference related data?
Embed when related data is frequently read together and stays reasonably sized; reference when data grows unbounded, is shared across documents, or requires separate lifecycle management.
How do I diagnose a slow query?
Run explain() for your query to see index usage and stage execution; check index coverage, use projection, and consider adding or adjusting compound indexes. Monitor CPU, I/O, and page faults for resource bottlenecks.