[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ETSS5QGDVGS9RXMSSAP4DP":3,"skill-same:01M7ETSS5QGDVGS9RXMSSAP4DP":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7ETSS5QGDVGS9RXMSSAP4DP","mongodb-pro",null,"MongoDB modeling, aggregation pipelines, and operations — use when designing schemas or tuning Mongo queries.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-mongodb-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: mongodb-pro\ndescription: MongoDB modeling, aggregation pipelines, and operations — use when designing schemas or tuning Mongo queries.\ncategory: database\n---\n\n## Overview\n\nMongoDB trades rigid schemas for flexible documents, which makes modeling choices\n— embed vs reference — the central skill. This skill covers schema design,\naggregation pipelines, indexing, and the operational basics (replica sets,\ntransactions, backups).\n\n## When to use\n\n- Deciding whether to embed documents or reference across collections\n- Writing aggregation pipelines (`$match`, `$group`, `$lookup`, `$unwind`)\n- Creating compound, text, geospatial, or TTL indexes\n- Debugging slow queries with `explain(\"executionStats\")`\n- Setting up replica sets, transactions, or change streams\n\n## Core concepts\n\n**Model for your queries, not your entities.** Embed data that is read together\nand rarely changes independently (order → line items). Reference data that is\nshared, large, or updated independently (order → customer). The 16MB document\nlimit and unbounded array growth are the guardrails — an ever-growing embedded\narray is a schema smell.\n\n**Aggregation pipelines are programs.** Stages execute in order; put `$match`\nand `$project` early to shrink the working set before expensive stages like\n`$group` or `$lookup`. `allowDiskUse` saves memory-heavy pipelines from failing,\nat a speed cost.\n\n**Indexes follow the ESR rule.** For a query with Equality, Sort, and Range\npredicates, order compound index fields as Equality → Sort → Range. Prefix\ncompression and index intersection exist, but a purpose-built compound index\nalmost always wins.\n\n**Replica sets are mandatory in spirit.** Even a single-node \"replica set\" is\nrequired for transactions and change streams. Design for primary\u002Fsecondary\ntopology: writes go to the primary; tune read preference (`secondaryPreferred`\nfor analytics) consciously, knowing secondaries can lag.\n\n**Transactions exist — use sparingly.** Multi-document ACID transactions are\navailable but slower than single-document atomicity, which covers most embedded\ndesigns. If you need transactions everywhere, your schema may be too normalized\nfor a document database.\n\n## Practical workflow\n\n1. **List your top 10 queries first**, with frequency and latency needs — the\n   schema follows from these, not from the ER diagram.\n2. **Prototype the pipeline in stages:** run each stage in `mongosh` or Compass\n   and inspect intermediate output; check `.explain(\"executionStats\")` for\n   `COLLSCAN` (bad) vs `IXSCAN` (good).\n3. **Index deliberately:** create compound indexes matching your hottest queries;\n   use partial indexes (`partialFilterExpression`) for sparse patterns and TTL\n   indexes for expiring data (sessions, logs).\n4. **Guard writes:** use schema validation (`$jsonSchema`) to enforce the fields\n   your code depends on, while leaving the rest flexible.\n5. **Monitor:** `db.serverStatus()`, slow query logs, and Atlas-style metrics —\n   watch for growing lock contention, page faults, and replication lag.\n6. **Back up with mongodump or snapshots** on a schedule, and practice restores;\n   for replica sets, back up from a secondary to avoid primary load.\n\n## Common pitfalls\n\n- **Unbounded arrays** (e.g. appending every event to a user document forever) —\n  documents bloat, updates rewrite megabytes, and the 16MB cap eventually bites.\n  Cap arrays (`$slice`) or move to a separate collection.\n- **`$lookup` as a crutch for joins everywhere** — occasional lookups are fine;\n  constant cross-collection joins suggest the data should be embedded or the\n  workload belongs in a relational database.\n- **No indexes on sort fields** — sorting 1M documents in memory fails or crawls;\n  the sort field belongs in the compound index (ESR rule).\n- **Treating `_id` as a string** when it's an ObjectId — type mismatches silently\n  return zero results. Query with the correct type.\n- **Write concern \u002F read concern left at defaults** in systems that need\n  durability guarantees — understand `w: \"majority\"` before promising \"saved\".\n- **Storing large binaries in documents** — use GridFS or object storage with a\n  reference; documents are for data, not file blobs.\n","## Overview\n\nMongoDB trades rigid schemas for flexible documents, which makes modeling choices\n— embed vs reference — the central skill. This skill covers schema design,\naggregation pipelines, indexing, and the operational basics (replica sets,\ntransactions, backups).\n\n## When to use\n\n- Deciding whether to embed documents or reference across collections\n- Writing aggregation pipelines (`$match`, `$group`, `$lookup`, `$unwind`)\n- Creating compound, text, geospatial, or TTL indexes\n- Debugging slow queries with `explain(\"executionStats\")`\n- Setting up replica sets, transactions, or change streams\n\n## Core concepts\n\n**Model for your queries, not your entities.** Embed data that is read together\nand rarely changes independently (order → line items). Reference data that is\nshared, large, or updated independently (order → customer). The 16MB document\nlimit and unbounded array growth are the guardrails — an ever-growing embedded\narray is a schema smell.\n\n**Aggregation pipelines are programs.** Stages execute in order; put `$match`\nand `$project` early to shrink the working set before expensive stages like\n`$group` or `$lookup`. `allowDiskUse` saves memory-heavy pipelines from failing,\nat a speed cost.\n\n**Indexes follow the ESR rule.** For a query with Equality, Sort, and Range\npredicates, order compound index fields as Equality → Sort → Range. Prefix\ncompression and index intersection exist, but a purpose-built compound index\nalmost always wins.\n\n**Replica sets are mandatory in spirit.** Even a single-node \"replica set\" is\nrequired for transactions and change streams. Design for primary\u002Fsecondary\ntopology: writes go to the primary; tune read preference (`secondaryPreferred`\nfor analytics) consciously, knowing secondaries can lag.\n\n**Transactions exist — use sparingly.** Multi-document ACID transactions are\navailable but slower than single-document atomicity, which covers most embedded\ndesigns. If you need transactions everywhere, your schema may be too normalized\nfor a document database.\n\n## Practical workflow\n\n1. **List your top 10 queries first**, with frequency and latency needs — the\n   schema follows from these, not from the ER diagram.\n2. **Prototype the pipeline in stages:** run each stage in `mongosh` or Compass\n   and inspect intermediate output; check `.explain(\"executionStats\")` for\n   `COLLSCAN` (bad) vs `IXSCAN` (good).\n3. **Index deliberately:** create compound indexes matching your hottest queries;\n   use partial indexes (`partialFilterExpression`) for sparse patterns and TTL\n   indexes for expiring data (sessions, logs).\n4. **Guard writes:** use schema validation (`$jsonSchema`) to enforce the fields\n   your code depends on, while leaving the rest flexible.\n5. **Monitor:** `db.serverStatus()`, slow query logs, and Atlas-style metrics —\n   watch for growing lock contention, page faults, and replication lag.\n6. **Back up with mongodump or snapshots** on a schedule, and practice restores;\n   for replica sets, back up from a secondary to avoid primary load.\n\n## Common pitfalls\n\n- **Unbounded arrays** (e.g. appending every event to a user document forever) —\n  documents bloat, updates rewrite megabytes, and the 16MB cap eventually bites.\n  Cap arrays (`$slice`) or move to a separate collection.\n- **`$lookup` as a crutch for joins everywhere** — occasional lookups are fine;\n  constant cross-collection joins suggest the data should be embedded or the\n  workload belongs in a relational database.\n- **No indexes on sort fields** — sorting 1M documents in memory fails or crawls;\n  the sort field belongs in the compound index (ESR rule).\n- **Treating `_id` as a string** when it's an ObjectId — type mismatches silently\n  return zero results. Query with the correct type.\n- **Write concern \u002F read concern left at defaults** in systems that need\n  durability guarantees — understand `w: \"majority\"` before promising \"saved\".\n- **Storing large binaries in documents** — use GridFS or object storage with a\n  reference; documents are for data, not file blobs.\n",{"name":5,"category":24,"description":7},"database","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-mongodb-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill mongodb-pro",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill mongodb-pro",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill mongodb-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-mongodb-pro\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]