jyjeanne/ai-setup-forge/mongodb-aggregation

Claude Code and agent skill by jyjeanne/ai-setup-forge

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

To perform complex data processing, transformation, and analysis directly within MongoDB using pipelines. Use when: When simple find() queries are insufficient; For grouping, summing, or averaging data (analytics); For joining collections ($lookup).

Install

npx vskill@latest install jyjeanne/ai-setup-forge/mongodb-aggregation

SKILL.md

The same SKILL.md was published earlier as jyjeanne/ai-setup-forge/mongodb-aggregation.

Purpose

To perform complex data processing, transformation, and analysis directly within MongoDB using pipelines.

When to Use

  • When simple find() queries are insufficient.
  • For grouping, summing, or averaging data (analytics).
  • For joining collections ($lookup).

Procedure

1. Structure

An aggregation pipeline is an array of stages. Documents pass through stages in order.

javascript
db.collection.aggregate([
{ $stage1: { ... } },
{ $stage2: { ... } }
])
2. Common Stages
A. Filtering ($match)

Always place this first to reduce dataset size early.

javascript
{ $match: { status: "completed" } }
B. Grouping ($group)

Calculate metrics.

javascript
{
$group: {
_id: "$customerId", // Group by customer
totalSpent: { $sum: "$amount" },
averageOrder: { $avg: "$amount" }
}
}
C. Joining ($lookup)

Left outer join with another collection.

javascript
{
$lookup: {
from: "users",
localField: "userId",
foreignField: "_id",
as: "userDetails"
}
}
D. Projections ($project)

Shape the output.

javascript
{
$project: {
name: 1,
totalSpent: 1,
_id: 0
}
}
3. Optimization
  • Ensure the first $match stage hits an index.
  • Use $limit and $skip for pagination.

Constraints

  • Memory Limit: Each stage has a 100MB RAM limit. Use { allowDiskUse: true } for large operations, though it is slower.
  • Complexity: Debugging long pipelines is difficult; build them stage by stage.

Expected Output

Transformed and aggregated data returned efficiently without pulling all raw documents into the application layer.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
8

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jyjeanne/ai-setup-forge/mongodb-aggregation/badge)](https://verified-skill.com/skills/jyjeanne/ai-setup-forge/mongodb-aggregation)

Something wrong with this skill or its page? Tell us.