{
  "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": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/mongodb",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mongodb",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "aggregation.md",
      "indexes.md",
      "production.md",
      "schema.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "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."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "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."
        },
        {
          "label": "Upgrade existing",
          "body": "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."
        }
      ]
    },
    "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."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/mongodb",
    "agentPageUrl": "https://openagent3.xyz/skills/mongodb/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mongodb/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mongodb/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "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."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "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."
      },
      {
        "label": "Upgrade existing",
        "body": "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."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "When to Use",
        "body": "User needs MongoDB expertise — from schema design to production optimization. Agent handles document modeling, indexing strategies, aggregation pipelines, consistency patterns, and scaling."
      },
      {
        "title": "Quick Reference",
        "body": "TopicFileSchema design patternsschema.mdIndex strategiesindexes.mdAggregation pipelineaggregation.mdProduction configurationproduction.md"
      },
      {
        "title": "Schema Design Philosophy",
        "body": "Embed when data is queried together and doesn't grow unboundedly\nReference when data is large, accessed independently, or many-to-many\nDenormalize for read performance, accept update complexity—no JOINs means duplicate data\nDesign for your queries, not for normalized elegance"
      },
      {
        "title": "Document Size Traps",
        "body": "16MB max per document—plan for this from day one; use GridFS for large files\nArrays that grow infinitely = disaster—use bucketing pattern instead\nBSON overhead: field names repeated per document—short names save space at scale\nNested depth limit 100 levels—rarely hit but exists"
      },
      {
        "title": "Array Traps",
        "body": "Arrays > 1000 elements hurt performance—pagination inside documents is hard\n$push without $slice = unbounded growth; use $push: {$each: [...], $slice: -100}\nMultikey indexes on arrays: index entry per element—can explode index size\nCan't have multikey index on more than one array field in compound index"
      },
      {
        "title": "$lookup Traps",
        "body": "$lookup performance degrades with collection size—no index on foreign collection (until 5.0)\nOne $lookup per pipeline stage—nested lookups get complex and slow\n$lookup with pipeline (5.0+) can filter before joining—massive improvement\nConsider: if you $lookup frequently, maybe embed instead"
      },
      {
        "title": "Index Strategy",
        "body": "ESR rule: Equality fields first, Sort fields next, Range fields last\nMongoDB doesn't do efficient index intersection—single compound index often better\nOnly one text index per collection—plan carefully; use Atlas Search for complex text\nTTL index for auto-expiration: {createdAt: 1}, {expireAfterSeconds: 86400}"
      },
      {
        "title": "Consistency Traps",
        "body": "Default read/write concern not fully consistent—{w: \"majority\", readConcern: \"majority\"} for strong\nMulti-document transactions since 4.0—but add latency and lock overhead; design to minimize\nSingle-document operations are atomic—exploit this by embedding related data\nretryWrites: true in connection string—handles transient failures automatically"
      },
      {
        "title": "Read Preference Traps",
        "body": "Stale reads on secondaries—replication lag can be seconds\nnearest for lowest latency—but may read stale data\nWrite always goes to primary—read preference doesn't affect writes\nRead your own writes: use primary or session-based causal consistency"
      },
      {
        "title": "ObjectId Traps",
        "body": "Contains timestamp: ObjectId.getTimestamp()—extract creation time without extra field\nRoughly time-ordered—can sort by _id for creation order without createdAt\nNot random—predictable if you know creation time; don't rely on for security tokens"
      },
      {
        "title": "Performance Mindset",
        "body": "explain(\"executionStats\") shows actual execution—not just theoretical plan\ntotalDocsExamined vs nReturned ratio should be ~1—otherwise index missing\nCOLLSCAN in explain = full collection scan—add appropriate index\nCovered queries: IXSCAN + totalDocsExamined: 0—all data from index"
      },
      {
        "title": "Aggregation Philosophy",
        "body": "Pipeline stages are transformations—think of data flowing through\nFilter early ($match), project early ($project)—reduce data volume ASAP\n$match at start can use indexes; $match after $unwind cannot\nTest complex pipelines stage by stage—build incrementally"
      },
      {
        "title": "Common Mistakes",
        "body": "Treating MongoDB as \"schemaless\"—still need schema design; just enforced in app not DB\nNot adding indexes—scans entire collection; every query pattern needs index\nGiant documents via array pushes—hit 16MB limit or slow BSON parsing\nIgnoring write concern—data may appear written but not persisted/replicated"
      }
    ],
    "body": "When to Use\n\nUser needs MongoDB expertise — from schema design to production optimization. Agent handles document modeling, indexing strategies, aggregation pipelines, consistency patterns, and scaling.\n\nQuick Reference\nTopic\tFile\nSchema design patterns\tschema.md\nIndex strategies\tindexes.md\nAggregation pipeline\taggregation.md\nProduction configuration\tproduction.md\nSchema Design Philosophy\nEmbed when data is queried together and doesn't grow unboundedly\nReference when data is large, accessed independently, or many-to-many\nDenormalize for read performance, accept update complexity—no JOINs means duplicate data\nDesign for your queries, not for normalized elegance\nDocument Size Traps\n16MB max per document—plan for this from day one; use GridFS for large files\nArrays that grow infinitely = disaster—use bucketing pattern instead\nBSON overhead: field names repeated per document—short names save space at scale\nNested depth limit 100 levels—rarely hit but exists\nArray Traps\nArrays > 1000 elements hurt performance—pagination inside documents is hard\n$push without $slice = unbounded growth; use $push: {$each: [...], $slice: -100}\nMultikey indexes on arrays: index entry per element—can explode index size\nCan't have multikey index on more than one array field in compound index\n$lookup Traps\n$lookup performance degrades with collection size—no index on foreign collection (until 5.0)\nOne $lookup per pipeline stage—nested lookups get complex and slow\n$lookup with pipeline (5.0+) can filter before joining—massive improvement\nConsider: if you $lookup frequently, maybe embed instead\nIndex Strategy\nESR rule: Equality fields first, Sort fields next, Range fields last\nMongoDB doesn't do efficient index intersection—single compound index often better\nOnly one text index per collection—plan carefully; use Atlas Search for complex text\nTTL index for auto-expiration: {createdAt: 1}, {expireAfterSeconds: 86400}\nConsistency Traps\nDefault read/write concern not fully consistent—{w: \"majority\", readConcern: \"majority\"} for strong\nMulti-document transactions since 4.0—but add latency and lock overhead; design to minimize\nSingle-document operations are atomic—exploit this by embedding related data\nretryWrites: true in connection string—handles transient failures automatically\nRead Preference Traps\nStale reads on secondaries—replication lag can be seconds\nnearest for lowest latency—but may read stale data\nWrite always goes to primary—read preference doesn't affect writes\nRead your own writes: use primary or session-based causal consistency\nObjectId Traps\nContains timestamp: ObjectId.getTimestamp()—extract creation time without extra field\nRoughly time-ordered—can sort by _id for creation order without createdAt\nNot random—predictable if you know creation time; don't rely on for security tokens\nPerformance Mindset\nexplain(\"executionStats\") shows actual execution—not just theoretical plan\ntotalDocsExamined vs nReturned ratio should be ~1—otherwise index missing\nCOLLSCAN in explain = full collection scan—add appropriate index\nCovered queries: IXSCAN + totalDocsExamined: 0—all data from index\nAggregation Philosophy\nPipeline stages are transformations—think of data flowing through\nFilter early ($match), project early ($project)—reduce data volume ASAP\n$match at start can use indexes; $match after $unwind cannot\nTest complex pipelines stage by stage—build incrementally\nCommon Mistakes\nTreating MongoDB as \"schemaless\"—still need schema design; just enforced in app not DB\nNot adding indexes—scans entire collection; every query pattern needs index\nGiant documents via array pushes—hit 16MB limit or slow BSON parsing\nIgnoring write concern—data may appear written but not persisted/replicated"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/ivangdavila/mongodb",
    "publisherUrl": "https://clawhub.ai/ivangdavila/mongodb",
    "owner": "ivangdavila",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "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"
  }
}