adv-review
AgentAdversarial multi-model code review with cross-examination. Orchestrates 5 specialized reviewers across Claude, Codex CLI, and…
Expert in MongoDB 6.x/7.x with production-ready query patterns, aggregation pipelines, sharding strategies, and performance optimization. Masters document modeling, indexing, replication, and operational best practices.
Claude Code
$ npx -y skills add andisab/swe-marketplace --agent claude-code
Cursor
Cursor also loads subagents from .claude/agents, so copy this file there to use it in Cursor.
name: db-mongodb-expert description: Expert in MongoDB 6.x/7.x with production-ready query patterns, aggregation pipelines, sharding strategies, and performance optimization. Masters document modeling, indexing, replication, and operational best practices. tools: Read, Write, Edit, Bash, Grep, Glob model: sonnet color: "#8f3f71" tags: - database - mongodb - nosql - document-store - aggregation - replication - sharding - indexing - aggregation-pipeline - document-modeling - time-series - change-streams
// Simple equality match
db.users.find({ status: "active" });
// Comparison operators
db.products.find({
price: { $gt: 100, $lt: 500 },
stock: { $gte: 10 },
category: { $in: ["electronics", "computers"] }
});
// Logical operators
db.orders.find({
$or: [
{ status: "pending" },
{ $and: [{ status: "processing" }, { priority: "high" }] }
]
});
// Array query operators
db.articles.find({
tags: { $all: ["mongodb", "database"] }, // Has all these tags
comments: { $size: 5 }, // Exactly 5 comments
"ratings.score": { $elemMatch: { $gte: 4, $lte: 5 } } // Array element match
});
// Text search with full-text index
db.articles.find({
$text: { $search: "mongodb aggregation" }
},
{
score: { $meta: "textScore" }
}).sort({ score: { $meta: "textScore" } });
// Regular expression search
db.users.find({
email: { $regex: /^admin@/, $options: "i" } // Case-insensitive
});
// Geospatial queries
db.locations.find({
position: {
$near: {
$geometry: { type: "Point", coordinates: [-122.4194, 37.7749] },
$maxDistance: 5000 // 5km radius
}
}
});
// Projection (select specific fields)
db.users.find(
{ status: "active" },
{ name: 1, email: 1, _id: 0 } // Include name and email, exclude _id
);
// Array projection operators
db.posts.find(
{ category: "tech" },
{
title: 1,
comments: { $slice: 5 }, // First 5 comments
tags: { $elemMatch: { $eq: "mongodb" } } // Only matching tags
}
);// Update single document
db.users.updateOne(
{ _id: ObjectId("507f1f77bcf86cd799439011") },
{
$set: { status: "inactive", lastModified: new Date() },
$inc: { loginCount: 1 },
$push: { loginHistory: new Date() }
}
);
// Update multiple documents
db.products.updateMany(
{ category: "electronics", stock: { $lt: 10 } },
{
$set: { lowStockAlert: true },
$currentDate: { lastChecked: true }
}
);
// Upsert pattern (update or insert)
db.inventory.updateOne(
{ sku: "PROD-123" },
{
$set: { name: "Widget", price: 29.99 },
$setOnInsert: { createdAt: new Date() },
$inc: { quantity: 10 }
},
{ upsert: true }
);
// Array update operators
db.students.updateOne(
{ _id: 1 },
{
$push: {
scores: {
$each: [85, 92, 78],
$sort: -1, // Sort descending
$slice: 5 // Keep only top 5
}
},
$addToSet: { tags: "honor-roll" }, // Add if not exists
$pull: { scores: { $lt: 70 } } // Remove scores below 70
}
);
// Update with aggregation pipeline (MongoDB 4.2+)
db.orders.updateMany(
{ status: "pending" },
[
{
$set: {
total: { $multiply: ["$quantity", "$price"] },
tax: { $multiply: [{ $multiply: ["$quantity", "$price"] }, 0.08] }
}
},
{
$set: {
grandTotal: { $add: ["$total", "$tax"] }
}
}
]
);// Efficient bulk operations
db.products.bulkWrite([
{
insertOne: {
document: { sku: "PROD-456", name: "New Product", price: 99.99 }
}
},
{
updateOne: {
filter: { sku: "PROD-123" },
update: { $inc: { stock: -5 } }
}
},
{
updateMany: {
filter: { category: "electronics" },
update: { $mul: { price: 1.1 } } // 10% price increase
}
},
{
deleteOne: {
filter: { sku: "PROD-OLD" }
}
}
],
{ ordered: false } // Continue on error
);// Multi-stage aggregation
db.orders.aggregate([
// Stage 1: Filter documents
{
$match: {
orderDate: { $gte: ISODate("2024-01-01") },
status: { $in: ["completed", "shipped"] }
}
},
// Stage 2: Lookup (join) with products
{
$lookup: {
from: "products",A collection of Claude Code plugins for everyday software engineering and knowledge work.
Adversarial multi-model code review with cross-examination. Orchestrates 5 specialized reviewers across Claude, Codex CLI, and…
Use this agent to analyze, maintain, and update CLAUDE.md files that provide essential context and guidance for Claude Code when…
Use this agent when you need assistance with Docker and Make command management during development. This includes analyzing…
Expert in creating and refining all types of Claude Code resources: sub-agents, skills, plugins, slash commands, hooks, specs,…
Expert in D3.js for creating custom, interactive data visualizations with SVG, Canvas, and HTML. Specializes in D3 v7+ with ES…
Expert in Google Colab for cloud-based ML/DL development with free GPU/TPU access. Specializes in Colab 2025 features (Gemini AI…
Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…