# Send MongoDB to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "mongodb",
    "name": "MongoDB",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/ivangdavila/mongodb",
    "canonicalUrl": "https://clawhub.ai/ivangdavila/mongodb",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/mongodb",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mongodb",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "aggregation.md",
      "indexes.md",
      "production.md",
      "schema.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "mongodb",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T15:43:48.288Z",
      "expiresAt": "2026-05-09T15:43:48.288Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mongodb",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mongodb",
        "contentDisposition": "attachment; filename=\"mongodb-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "mongodb"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/mongodb"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/mongodb",
    "downloadUrl": "https://openagent3.xyz/downloads/mongodb",
    "agentUrl": "https://openagent3.xyz/skills/mongodb/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mongodb/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mongodb/agent.md"
  }
}
```
## Documentation

### When to Use

User needs MongoDB expertise — from schema design to production optimization. Agent handles document modeling, indexing strategies, aggregation pipelines, consistency patterns, and scaling.

### Quick Reference

TopicFileSchema design patternsschema.mdIndex strategiesindexes.mdAggregation pipelineaggregation.mdProduction configurationproduction.md

### Schema Design Philosophy

Embed when data is queried together and doesn't grow unboundedly
Reference when data is large, accessed independently, or many-to-many
Denormalize for read performance, accept update complexity—no JOINs means duplicate data
Design for your queries, not for normalized elegance

### Document Size Traps

16MB max per document—plan for this from day one; use GridFS for large files
Arrays that grow infinitely = disaster—use bucketing pattern instead
BSON overhead: field names repeated per document—short names save space at scale
Nested depth limit 100 levels—rarely hit but exists

### Array Traps

Arrays > 1000 elements hurt performance—pagination inside documents is hard
$push without $slice = unbounded growth; use $push: {$each: [...], $slice: -100}
Multikey indexes on arrays: index entry per element—can explode index size
Can't have multikey index on more than one array field in compound index

### $lookup Traps

$lookup performance degrades with collection size—no index on foreign collection (until 5.0)
One $lookup per pipeline stage—nested lookups get complex and slow
$lookup with pipeline (5.0+) can filter before joining—massive improvement
Consider: if you $lookup frequently, maybe embed instead

### Index Strategy

ESR rule: Equality fields first, Sort fields next, Range fields last
MongoDB doesn't do efficient index intersection—single compound index often better
Only one text index per collection—plan carefully; use Atlas Search for complex text
TTL index for auto-expiration: {createdAt: 1}, {expireAfterSeconds: 86400}

### Consistency Traps

Default read/write concern not fully consistent—{w: "majority", readConcern: "majority"} for strong
Multi-document transactions since 4.0—but add latency and lock overhead; design to minimize
Single-document operations are atomic—exploit this by embedding related data
retryWrites: true in connection string—handles transient failures automatically

### Read Preference Traps

Stale reads on secondaries—replication lag can be seconds
nearest for lowest latency—but may read stale data
Write always goes to primary—read preference doesn't affect writes
Read your own writes: use primary or session-based causal consistency

### ObjectId Traps

Contains timestamp: ObjectId.getTimestamp()—extract creation time without extra field
Roughly time-ordered—can sort by _id for creation order without createdAt
Not random—predictable if you know creation time; don't rely on for security tokens

### Performance Mindset

explain("executionStats") shows actual execution—not just theoretical plan
totalDocsExamined vs nReturned ratio should be ~1—otherwise index missing
COLLSCAN in explain = full collection scan—add appropriate index
Covered queries: IXSCAN + totalDocsExamined: 0—all data from index

### Aggregation Philosophy

Pipeline stages are transformations—think of data flowing through
Filter early ($match), project early ($project)—reduce data volume ASAP
$match at start can use indexes; $match after $unwind cannot
Test complex pipelines stage by stage—build incrementally

### Common Mistakes

Treating MongoDB as "schemaless"—still need schema design; just enforced in app not DB
Not adding indexes—scans entire collection; every query pattern needs index
Giant documents via array pushes—hit 16MB limit or slow BSON parsing
Ignoring write concern—data may appear written but not persisted/replicated
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: ivangdavila
- Version: 1.0.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-02T15:43:48.288Z
- Expires at: 2026-05-09T15:43:48.288Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/mongodb)
- [Send to Agent page](https://openagent3.xyz/skills/mongodb/agent)
- [JSON manifest](https://openagent3.xyz/skills/mongodb/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/mongodb/agent.md)
- [Download page](https://openagent3.xyz/downloads/mongodb)