/db-mongodb:mongodb-frameworksfrom db-mongodb
Use when implementing MongoDB code with frameworks — enforces patterns for Mongoose (schemas, middleware, virtuals, populate), Motor (async cursors), MongoDB .NET Driver (BSON, LINQ), and migrate-mongo (migration scripts)
Ships in db-mongodb. 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.
None: SKILL.md is the whole skill.
collection option explicitlytimestamps: true for automatic createdAt/updatedAtlean() for read-only queries (returns plain objects, not Mongoose documents)validate → save → remove (document middleware)find → findOne → findOneAndUpdate (query middleware)aggregate (aggregate middleware)const paymentSchema = new Schema({ amount: Number, currency: String });
const Payment = mongoose.model('Payment', paymentSchema);
const CreditCardPayment = Payment.discriminator('CreditCard',
new Schema({ cardNumber: String, expiry: String }));
const BankTransfer = Payment.discriminator('BankTransfer',
new Schema({ accountNumber: String, routingNumber: String }));
to_list(length=N) with bounded length — never to_list(length=None) on large collectionsmotor.motor_asyncio.AsyncIOMotorClient for async operationsmaxPoolSize, minPoolSize, maxIdleTimeMScodec_options for automatic type conversionpublic class OrderRepository
{
private readonly IMongoCollection<Order> _collection;
public OrderRepository(IMongoDatabase database)
{
_collection = database.GetCollection<Order>("orders");
}
public async Task<Order?> GetByIdAsync(string id)
{
return await _collection.Find(o => o.Id == id).FirstOrDefaultAsync();
}
public async Task CreateAsync(Order order)
{
await _collection.InsertOneAsync(order);
}
}
var results = await _collection.AsQueryable()
.Where(o => o.Status == OrderStatus.Pending)
.OrderByDescending(o => o.CreatedAt)
.Take(20)
.ToListAsync();
up and downdb.collection() not model imports (framework-agnostic)add-customer-status-index, backfill-email-verifiedWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gagandeepp/software-agent-teams --plugin db-mongodbOther plugins' skills for the same job
4 skills in this plugin
/mongodb-codingUse when writing or reviewing MongoDB code — enforces document design patterns (embed vs reference), schema validation, aggregation pipelines, indexing strategies (ESR rule), change streams, transactions, and security best practices/mongodb-project-structureUse when scaffolding or reviewing MongoDB project layout — collection organization, migration script conventions, model/schema file layout, and index definition patterns/mongodb-testingUse when writing tests for MongoDB code — Jest with mongodb-memory-server for Node.js, pytest with mongomock for Python, .NET integration tests with test containers, and seed data management