mongodb · hoodini — Claude Code skill: schemas, queries, aggregation
A skill that walks your agent through MongoDB and Mongoose: schema design, queries, indexes and update operators.
npx skills add hoodini/ai-agents-skills --skill mongodb -a claude-codeWhat mongodb does
The skill loads into your agent and supplies working TypeScript examples for MongoDB. Native driver setup covers MongoClient, client.db() and basic CRUD. The Mongoose part shows mongoose.connect with pool size and timeouts, connection event handlers, and closing the connection on SIGINT.
Schema design gets its own section: required fields, enum, select: false on passwords, timestamps, and indexes including compound and text. There is a clear split between embedding documents and referencing them with ObjectId plus populate, and virtuals for reverse references. Query operators follow — $gt, $in, $and, $or, $exists, $size, $text, $regex — along with updates like $set, $unset, $inc and $mul.
You need the packages installed first: npm install mongodb mongoose. The examples read the connection string from MONGODB_URI, so a project without that variable will need edits before anything runs. The skill text stops partway through the update operators, at $min — past that point your agent is on its own.
What it helps with
- design a Mongoose schema with validation and indexes
- decide between embedding a document and referencing it
- write a query with comparison and logical operators
- populate nested references with selected fields
- set up connection pooling and graceful shutdown
Example prompts for the agent
- Help me design a Mongoose User schema with indexes and a hidden password field
- Write a query using $or and $gte on createdAt
- How do I populate the author and comments on a Post?
How to install mongodb
1Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill mongodb -a claude-code2Manually: put the files in place
~/.claude/skills/mongodb/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/mongodb/
1Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill mongodb -a codex2Manually: put the files in place
.agents/skills/mongodb/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill mongodb -a cursor2Manually: put the files in place
.cursor/skills/mongodb/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hoodini/ai-agents-skills mongodb2Manually: put the files in place
.github/skills/mongodb/SKILL.md1Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill mongodb -a gemini-cli2Platform CLI
gemini skills install https://github.com/hoodini/ai-agents-skills --path skills/mongodbManually: put the files in place
.devin/skills/mongodb/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hoodini/ai-agents-skills --skill mongodb -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about mongodb
How do I install mongodb in Claude?
Run npx skills add hoodini/ai-agents-skills --skill mongodb -a claude-code. The skill lands at ~/.claude/skills/mongodb/SKILL.md.
What does the mongodb skill do?
It gives your agent MongoDB and Mongoose examples: schemas, queries, update operators, indexes, populate and virtuals.
What do I need for the skill to work?
The mongodb and mongoose packages in your project, plus a MONGODB_URI environment variable for the connection string.
Similar skills
All skills for Data and databases →mongodb by other authors comes first.