
mongodb-atlas
MongoDB Atlas cloud database management including clusters, schemas, aggregation pipelines, and Prisma ORM integration. Activate for MongoDB queries, schema design, indexing, and Atlas administration.
- Installs
- 51
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/thelobbi/claude --skill mongodb-atlas- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads mongodb-atlas automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
MongoDB Atlas Skill
Provides comprehensive MongoDB and MongoDB Atlas capabilities for the Alpha Members Platform.
When to Use This Skill
Activate this skill when working with:
- MongoDB query development
- Schema design and modeling
- Aggregation pipelines
- Index optimization
- Prisma MongoDB integration
- Atlas cluster management
- Database performance tuning
Quick Reference
Docker Commands
# Start local MongoDB
docker-compose up mongodb -d
# Connect to MongoDB shell
docker exec -it mongodb mongosh -u root -p rootpassword
# Check MongoDB logs
docker logs mongodb -f --tail=100
MongoDB Shell Commands
// Switch to database
use member_db
// List collections
show collections
// Find documents
db.members.find({ status: "ACTIVE" }).limit(10)
// Insert document
db.members.insertOne({ email: "test@example.com", status: "PENDING" })
// Update document
db.members.updateOne(
{ email: "test@example.com" },
{ $set: { status: "ACTIVE" } }
)
// Aggregation
db.members.aggregate([
{ $match: { status: "ACTIVE" } },
{ $group: { _id: "$profile.company", count: { $sum: 1 } } }
])
Connection Strings
# Local Docker
mongodb://root:rootpassword@localhost:27017/member_db?authSource=admin
# Atlas (example)
mongodb+srv://user:password@cluster.mongodb.net/member_db?retryWrites=true&w=majority
Schema Design
Prisma MongoDB Schema
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model Member {
id String @id @default(auto()) @map("_id") @db.ObjectId
keycloakUserId String @unique
email String @unique
firstName String
lastName String
status MemberStatus @default(PENDING)
profile MemberProfile? // Embedded
addresses MemberAddress[] // Embedded array
memberships Membership[] // Relation
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([status])
@@index([email])
}
type MemberProfile {
jobTitle String?
company String?
timezone String @default("UTC")
}
type MemberAddress {
type AddressType
street1 String
city String
state String
postalCode String
}
Collections
members
{
_id: ObjectId("..."),
keycloakUserId: "uuid",
email: "user@example.com",
firstName: "John",
lastName: "Doe",
status: "ACTIVE",
profile: {
jobTitle: "Engineer",
company: "Acme Corp"
},
addresses: [
{ type: "HOME", street1: "123 Main St", ... }
],
createdAt: ISODate("..."),
updatedAt: ISODate("...")
}
memberships
{
_id: ObjectId("..."),
memberId: ObjectId("..."),
type: "INDIVIDUAL",
level: "PREMIUM",
status: "ACTIVE",
startDate: ISODate("..."),
payment: {
method: "card",
amount: 99.99,
currency: "USD"
}
}
member_activities
{
_id: ObjectId("..."),
memberId: ObjectId("..."),
action: "LOGIN",
category: "AUTH",
ipAddress: "192.168.1.1",
createdAt: ISODate("...")
}
Indexing
Recommended Indexes
// Members collection
db.members.createIndex({ keycloakUserId: 1 }, { unique: true })
db.members.createIndex({ email: 1 }, { unique: true })
db.members.createIndex({ status: 1, createdAt: -1 })
db.members.createIndex({ "profile.company": 1 })
// Text search
db.members.createIndex({
firstName: "text",
lastName: "text",
email: "text",
"profile.company": "text"
})
// Memberships
db.memberships.createIndex({ memberId: 1 })
db.memberships.createIndex({ status: 1, endDate: 1 })
// Activities (with TTL)
db.member_activities.createIndex({ memberId: 1, createdAt: -1 })
db.member_activities.createIndex(
{ createdAt: 1 },
{ expireAfterSeconds: 31536000 } // 1 year TTL
)
Aggregation Pipelines
Member Statistics
db.members.aggregate([
{ $facet: {
byStatus: [
{ $group: { _id: "$status", count: { $sum: 1 } } }
],
byMonth: [
{ $group: {
_id: { $dateToString: { format: "%Y-%m", date: "$createdAt" } },
count: { $sum: 1 }
}
},
{ $sort: { _id: 1 } }
],
total: [{ $count: "count" }]
}
}
])
Member with Memberships
db.members.aggregate([
{ $match: { _id: ObjectId("...") } },
{ $lookup: {
from: "memberships",
localField: "_id",
foreignField: "memberId",
as: "memberships"
}
}
])
Prisma Operations
// Find member
const member = await prisma.member.findUnique({
where: { email: "user@example.com" },
include: { memberships: true }
});
// Create member with embedded profile
const newMember = await prisma.member.create({
data: {
email: "new@example.com",
firstName: "Jane",
lastName: "Doe",
keycloakUserId: "uuid",
profile: {
jobTitle: "Manager",
company: "Acme"
}
}
});
// Update with push to array
const updated = await prisma.member.update({
where: { id: "..." },
data: {
addresses: {
push: {
type: "WORK",
street1: "456 Office Blvd",
city: "Boston",
state: "MA",
postalCode: "02102"
}
}
}
});
// Aggregation with Prisma
const stats = await prisma.member.groupBy({
by: ['status'],
_count: true
});
Performance Optimization
Query Optimization
// Use projection to limit returned fields
db.members.find(
{ status: "ACTIVE" },
{ firstName: 1, lastName: 1, email: 1 }
)
// Use covered queries
db.members.find(
{ email: "user@example.com" },
{ _id: 0, email: 1, status: 1 }
).hint({ email: 1, status: 1 })
// Explain query plan
db.members.find({ status: "ACTIVE" }).explain("executionStats")
Index Analysis
// Get index usage stats
db.members.aggregate([{ $indexStats: {} }])
// Find unused indexes
db.members.aggregate([
{ $indexStats: {} },
{ $match: { "accesses.ops": 0 } }
])
Atlas CLI Commands
# Login to Atlas
atlas auth login
# List clusters
atlas clusters list --projectId <projectId>
# Create cluster
atlas clusters create alpha-dev \
--projectId <projectId> \
--provider AWS \
--region US_EAST_1 \
--tier M10
# Get connection string
atlas clusters connectionStrings describe alpha-dev
Project Files
- Prisma Schema:
prisma/schema.prisma - MongoDB Init:
infrastructure/mongo-init/01-init-db.js - Docker:
docker/docker-compose.yml(mongodb service)
Related Agents
- mongodb-atlas-admin - Cluster management
- mongodb-schema-designer - Schema design
- mongodb-query-optimizer - Performance tuning
- mongodb-aggregation-specialist - Complex queries
Troubleshooting
# Check MongoDB connection
docker exec mongodb mongosh --eval "db.adminCommand('ping')"
# Check replication status
docker exec mongodb mongosh --eval "rs.status()"
# Analyze slow queries
db.setProfilingLevel(1, { slowms: 100 })
db.system.profile.find().sort({ millis: -1 }).limit(10)
FAQ
What does the mongodb-atlas skill do?
MongoDB Atlas cloud database management including clusters, schemas, aggregation pipelines, and Prisma ORM integration. Activate for MongoDB queries, schema design, indexing, and Atlas administration.
How do I install mongodb-atlas?
Run npx skills add https://github.com/thelobbi/claude --skill mongodb-atlas in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/mongodb-atlas/ (personal) or .claude/skills/mongodb-atlas/ (project).
Which AI agents can use mongodb-atlas?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is mongodb-atlas safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains mongodb-atlas?
It is published by thelobbi in thelobbi/claude. It has 51 recorded installs.
More from thelobbi/claude
vision-multimodal
thelobbi/claude
Vision and multimodal capabilities for Claude including image analysis, PDF processing, and document understanding. Activate for image input, base64 encoding, multiple images, and visual analysis.
design-system
thelobbi/claude
Open the skill to read its SKILL.md instructions.
authentication
thelobbi/claude
Authentication and authorization including JWT, OAuth2, OIDC, sessions, RBAC, and security analysis. Activate for login, auth flows, security audits, threat modeling, access control, and identity management.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.