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-code

Installs 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

Repository
github.com/hoodini/ai-agents-skills
Categories
Backend & APIs, DevOps & CI/CD, Documentation, AI & Agent Building, Debugging, Automation & Workflows, Sales & Marketing, Databases

More from hoodini/ai-agents-skills

All 37
1jezweb avatarelevenlabs-agentsjezweb/claude-skillsBuild conversational AI voice agents on the ElevenLabs platform. Configure agent + tools + knowledge base, integrate SDK (React / React Native / Swift / JS / se1.7Kskills.sh installs
2cognitedata avatarmigrate-app-to-flowscognitedata/builder-skillsMUST be used when migrating a legacy Dune app to the new Flows app hosting infrastructure. Orchestrates the full migration: audits current state, updates app.js1.7Kskills.sh installs
3nexscope-ai avataramazon-keyword-researchnexscope-ai/amazon-skillsAmazon keyword research and market opportunity analysis for sellers. Retrieve autocomplete suggestions (long-tail keywords), analyze competitor landscape, and a1.7Kskills.sh installs
4patternsdev avatarcompressionpatternsdev/skillsTeaches JavaScript compression techniques including Gzip and Brotli. Use when optimizing network transfer times or configuring server-side compression for produ1.7Kskills.sh installs
5adobe avatarcode-reviewadobe/skillsUse this when reviewing AEM Edge Delivery Services (EDS, Franklin, Helix) code, either self-review at the end of development before opening a PR, or reviewing a1.7Kskills.sh installs
6adobe avatardocs-searchadobe/skillsUse this when you need more information about an AEM Edge Delivery Services (EDS, Franklin, Helix) feature or guidance on how to implement one, and your existin1.7Kskills.sh installs