/major-ai-skills:mongodbfrom major-ai-skills
Model MongoDB documents and compound indexes, tune read/write concern and TLS connection strings, run safe aggregations, and avoid backup/restore and majority-write traps on small replica sets.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
MongoDB stores BSON documents in collections. Query paths drive compound index design; the aggregation pipeline is a staged computation graph. Replica sets provide durability via oplog replication; write concern and read concern define what “acknowledged” means—agents often treat majority as free insurance without counting voting data-bearing nodes.
Drivers (TLS, authSource, replicaSet)
-> mongod replica set / sharded cluster
-> collections + indexes (B-tree, partial, TTL, text)
-> oplog -> secondary apply (async)
-> change streams (resume tokens)
Use when
find + sort + range on the same query shapeDo not use when
@postgresql)replicaSet, authSource, tls=true, and cert options for self-hosted; cap maxPoolSize; set serverSelectionTimeoutMS and connectTimeoutMS.majority is common; on P-S-A (primary + secondary + arbiter), w: majority can fail when the only data-bearing secondary is down—size replica sets for real redundancy or document degraded modes explicitly.$jsonSchema validation; online index builds still load the cluster—build during low traffic with background equivalent (modern builds use index build coordination—check server version docs).readPreference secondary for analytics only when stale reads are acceptable.updateOne filters on business keys.db.orders.createIndex({ customerId: 1, createdAt: -1 });
db.orders.createIndex(
{ status: 1 },
{ partialFilterExpression: { status: "open" } }
);
db.createCollection("orders", {
validator: {
$jsonSchema: {
bsonType: "object",
required: ["customerId", "status", "createdAt"],
properties: {
status: { enum: ["open", "paid", "cancelled"] },
items: { bsonType: "array", maxItems: 50 }
}
}
}
});
$matchdb.orders.aggregate([
{ $match: { createdAt: { $gte: ISODate("2026-01-01") }, status: "paid" } },
{ $group: { _id: "$customerId", revenue: { $sum: "$totalCents" } } },
{ $sort: { revenue: -1 } },
{ $limit: 50 }
]);
db.events.updateOne(
{ eventId: "evt-1042" },
{ $setOnInsert: { payload: doc, createdAt: new Date() } },
{ upsert: true }
);
db.orders.find({ customerId: id, status: "open" })
.sort({ createdAt: -1 })
.explain("executionStats");
mongodb://pbmuser:***@host1,host2,host3/?replicaSet=rs0&authSource=admin&tls=true&tlsCAFile=/etc/pbm/ca.pem&readConcernLevel=local&w=1
Use reduced concern only when majority is lost; restore only after majority is healthy (PBM guidance).
| Failure signature | Root cause | Diagnostic & fix |
|---|---|---|
COLLSCAN / high docsExamined | Missing or wrong index order | Align compound index with filter + sort |
WriteConcernError majority timeout | Too few data-bearing nodes up | Fix topology; temporary lower w with explicit risk doc |
| Duplicate events on retry | Non-idempotent handler | Upsert on natural key; store processed event IDs |
| Backup fails under outage | PBM default majority | Temporary local/w=1 per vendor docs; restore after majority |
| TLS handshake errors | Wrong CA / SNI / cert rotation | Fix tlsCAFile; rotate app certs before mongod |
| Transaction abort storms | Multi-doc tx on hot paths | Redesign embedding or outbox pattern |
invalidate on collection drops.opcounters, replication lag, and index build progress.0.0.0.0/0 without explicit approval.@postgresql — relational alternative when joins dominate@redis — cache hot Mongo reads@kafka — change capture / event outbox patternsMANDATORY: Always specify write/read concern implications when changing replica set topology or backup tools. Never recommend
sslAllowInvalidCertificatesin production. Design handlers idempotently; do not claim exactly-once without a dedupe key and proof.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization.Other plugins' skills for the same job
/act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.