
Mongodb
This one covers MongoDB and Mongoose from schema design through aggregation pipelines. You get practical examples of both the native driver and Mongoose ODM, with real decisions like when to embed documents versus use references. The code shows proper connection handling, indexing strategies, query operators, and update patterns. The aggregation section demonstrates pipeline stages for grouping and transforming data. What I like here is the focus on best practices you actually need: virtuals, population, text search, and those update operators that aren't always obvious. It's comprehensive enough to reference during implementation without drowning you in theory.
- skills.sh installs
- 1.7K
- GitHub stars
- 296
- last updated
- Aug 21, 2026
Install
$ npx -y skills add hoodini/ai-agents-skills --skill mongodb --agent claude-codeInstalls into .claude/skills of the current project.
Files
MongoDB & Mongoose
Build and query MongoDB databases with best practices.
Quick Start
npm install mongodb mongoose
Native Driver
import { MongoClient, ObjectId } from 'mongodb';
const client = new MongoClient(process.env.MONGODB_URI!);
const db = client.db('myapp');
const users = db.collection('users');
// Connect
await client.connect();
// CRUD Operations
await users.insertOne({ name: 'Alice', email: 'alice@example.com' });
const user = await users.findOne({ email: 'alice@example.com' });
await users.updateOne({ _id: user._id }, { $set: { name: 'Alice Smith' } });
await users.deleteOne({ _id: user._id });
Mongoose Setup
import mongoose from 'mongoose';
await mongoose.connect(process.env.MONGODB_URI!, {
maxPoolSize: 10,
serverSelectionTimeoutMS: 5000,
socketTimeoutMS: 45000,
});
// Connection events
mongoose.connection.on('connected', () => console.log('MongoDB connected'));
mongoose.connection.on('error', (err) => console.error('MongoDB error:', err));
mongoose.connection.on('disconnected', () => console.log('MongoDB disconnected'));
Sponsors
Details
More from hoodini/ai-agents-skills
All 37- Mobile Responsiveness1.4K
- Web Accessibility459
- Google Workspace Cli455
- Figma450
- Mermaid Diagrams408
- Analytics Metrics381
- Ux Design Systems270
- Aws Strands249
- Bun191
- Honest Agent190
- Nano Banana Pro189
- Fal Ai175
- Vercel173
- Langchain169
- Local Llm Router160
- Aws Account Management148
- Aws Agentcore148
- Copilot Docs147
- Cloudflare144
- Copilot Sdk139
- Railway135
- Shabbat Times134
- Cinematic Scrub Landing
- Meta Ads