[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-azure-documentdb-connection":3,"mdc-eb6fhx-key":32,"related-repo-azure-documentdb-connection":2797,"related-org-azure-documentdb-connection":2894},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":12,"stars":21,"repoUrl":22,"updatedAt":23,"license":24,"forks":25,"topics":26,"repo":27,"sourceUrl":30,"mdContent":31},"documentdb-connection","configure MongoDB connections for DocumentDB","Optimize MongoDB client connection configuration (pools, timeouts, patterns) for Azure DocumentDB. Use this skill when working on functions that instantiate or configure a MongoDB client (e.g., calling `connect()`), configuring connection pools, troubleshooting connection errors (ECONNREFUSED, timeouts, pool exhaustion), optimizing connection-related performance issues. Includes scenarios like building serverless functions, creating API endpoints, optimizing high-traffic applications, or debugging connection failures.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},"azure","Azure (Microsoft)","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fazure.png","Azure",[13,17,18],{"name":14,"slug":15,"type":16},"Performance","performance","tag",{"name":11,"slug":8,"type":16},{"name":19,"slug":20,"type":16},"Database","database",5,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fdocumentdb-agent-kit","2026-07-12T08:18:49.875358",null,7,[],{"repoUrl":22,"stars":21,"forks":25,"topics":28,"description":29},[],"Agent Skills pack for Azure DocumentDB (MongoDB compatibility) - vector search, full-text search, query optimization, connection tuning, local deployment, security, HA, and MCP setup.","https:\u002F\u002Fgithub.com\u002FAzure\u002Fdocumentdb-agent-kit\u002Ftree\u002FHEAD\u002Fskills\u002Fconnection","---\nname: documentdb-connection\ndescription: >-\n  Optimize MongoDB client connection configuration (pools, timeouts, patterns)\n  for Azure DocumentDB. Use this skill when working on\n  functions that instantiate or configure a MongoDB client (e.g., calling\n  `connect()`), configuring connection pools, troubleshooting connection errors\n  (ECONNREFUSED, timeouts, pool exhaustion), optimizing connection-related\n  performance issues. Includes scenarios like building serverless functions,\n  creating API endpoints, optimizing high-traffic applications, or debugging\n  connection failures.\n---\n\n# DocumentDB Connection Optimizer\n\nYou are an expert in MongoDB connection management for Azure DocumentDB\nacross all officially supported driver languages (Node.js,\nPython, Java, Go, C#, etc.). Your role is to ensure connection configurations\nare optimized for the user's specific environment and requirements.\n\n## Core Principle: Context Before Configuration\n\n**NEVER add connection pool parameters or timeout settings without first\nunderstanding the application's context.** Arbitrary values without\njustification lead to performance issues and harder-to-debug problems.\n\n## Understanding How Connection Pools Work\n\n- Connection pooling exists because establishing a MongoDB connection is\n  expensive (TCP + TLS + auth = 50–500ms). Without pooling, every operation\n  pays this cost.\n- Open connections consume memory on the server, ~1 MB per connection on\n  average, even when idle. Avoid having idle connections.\n\n**Connection Lifecycle:**\nBorrow from pool → Execute operation → Return to pool → Prune idle connections\nexceeding `maxIdleTimeMS`.\n\n**Synchronous vs Asynchronous Drivers:**\n- **Synchronous** (PyMongo `MongoClient`, Java sync): Thread blocks; pool size\n  often matches thread pool size\n- **Asynchronous** (Node.js, PyMongo `AsyncMongoClient`): Non-blocking I\u002FO;\n  smaller pools suffice\n\n> **Python async note:** Use PyMongo's native `AsyncMongoClient` (PyMongo\n> 4.9+), **not** Motor. MongoDB announced Motor's deprecation in May 2024 in\n> favor of PyMongo's built-in async API; Motor receives only critical fixes\n> through May 2026 and is end-of-life after that. New Python async code on\n> Azure DocumentDB should import `from pymongo import AsyncMongoClient`.\n\n**Monitoring Connections:** Each MongoClient establishes 2 monitoring\nconnections per replica set member. Formula:\n`Total = (minPoolSize + 2) × replica members × app instances`.\n\n## Azure DocumentDB Connection Specifics\n\n### Connection String Format\n\n```\nmongodb+srv:\u002F\u002F\u003Cusername>:\u003Cpassword>@\u003Ccluster-name>.mongocluster.cosmos.azure.com\u002F?tls=true&authMechanism=SCRAM-SHA-256&retryWrites=true\n```\n\nOr the non-SRV format:\n```\nmongodb:\u002F\u002F\u003Cusername>:\u003Cpassword>@\u003Ccluster-name>.mongocluster.cosmos.azure.com:10255\u002F?tls=true&authMechanism=SCRAM-SHA-256&retryWrites=true\n```\n\n### TLS Is Required\n\nAzure DocumentDB **always requires TLS**. Ensure:\n- `tls=true` in the connection string\n- If using self-signed certificates in development, configure the CA\n  certificate path in the driver\n\n### Authentication\n\n- Default mechanism: `SCRAM-SHA-256`\n- Credentials are managed through the Azure portal (cluster's connection\n  settings)\n\n## Configuration Design\n\n**Before suggesting any configuration changes**, ensure you have sufficient\ncontext about the user's application environment. If you don't have enough\ninformation, ask targeted questions. Ask **only one question at a time**.\n\n### Configuration Scenarios\n\n**General best practices:**\n- Create client once only and reuse across application\n- Don't manually close connections unless shutting down\n- Max pool size must exceed expected concurrency\n- Use timeouts to keep only the required connections ready\n- Use default max pool size (100) unless you have specific needs\n\n#### Scenario: Serverless Environments (Azure Functions, AWS Lambda)\n\n**Critical pattern:** Initialize client OUTSIDE handler\u002Ffunction scope to enable\nconnection reuse across warm invocations.\n\n| Parameter | Value | Reasoning |\n|-----------|-------|-----------|\n| `maxPoolSize` | 3–5 | Each function instance has its own pool |\n| `minPoolSize` | 0 | Prevent maintaining unused connections |\n| `maxIdleTimeMS` | 10–30s | Release unused connections quickly |\n| `connectTimeoutMS` | >0 | Set to longest expected network latency |\n| `socketTimeoutMS` | >0 | Ensure sockets are always closed |\n\n```javascript\n\u002F\u002F Azure Functions — initialize outside handler\nconst { MongoClient } = require('mongodb');\nconst client = new MongoClient(process.env.DOCUMENTDB_URI, {\n  maxPoolSize: 5,\n  minPoolSize: 0,\n  maxIdleTimeMS: 30000,\n});\n\nmodule.exports = async function (context, req) {\n  const db = client.db('mydb');\n  const result = await db.collection('items').findOne({});\n  context.res = { body: result };\n};\n```\n\n#### Scenario: Traditional Long-Running Servers (OLTP)\n\n| Parameter | Value | Reasoning |\n|-----------|-------|-----------|\n| `maxPoolSize` | 50+ | Based on peak concurrent requests |\n| `minPoolSize` | 10–20 | Pre-warmed connections for traffic spikes |\n| `maxIdleTimeMS` | 5–10min | Stable servers benefit from persistent connections |\n| `connectTimeoutMS` | 5–10s | Fail fast on connection issues |\n| `socketTimeoutMS` | 30s | Prevent hanging queries |\n| `serverSelectionTimeoutMS` | 5s | Quick failover |\n\n#### Scenario: OLAP \u002F Analytical Workloads\n\n| Parameter | Value | Reasoning |\n|-----------|-------|-----------|\n| `maxPoolSize` | 10–20 | Fewer concurrent operations |\n| `minPoolSize` | 0–5 | Queries are infrequent |\n| `socketTimeoutMS` | >0 | 2–3× the slowest expected operation |\n| `maxIdleTimeMS` | 10min | Minimize churn without keeping idle connections |\n\n#### Scenario: High-Traffic \u002F Bursty Workloads\n\n| Parameter | Value | Reasoning |\n|-----------|-------|-----------|\n| `maxPoolSize` | 100+ | Higher ceiling for sudden traffic spikes |\n| `minPoolSize` | 20–30 | More pre-warmed connections |\n| `maxConnecting` | 2 (default) | Prevent thundering herd |\n| `waitQueueTimeoutMS` | 2–5s | Fail fast when pool exhausted |\n| `maxIdleTimeMS` | 5min | Balance reuse and cleanup |\n\n## Singleton Client Pattern\n\nThe most important best practice: **create ONE MongoClient and reuse it.**\n\n```javascript\n\u002F\u002F ✅ Good — singleton pattern\nlet client;\nfunction getClient() {\n  if (!client) {\n    client = new MongoClient(process.env.DOCUMENTDB_URI);\n  }\n  return client;\n}\n\n\u002F\u002F ❌ Bad — creating new client per request\napp.get('\u002Fapi\u002Fdata', async (req, res) => {\n  const client = new MongoClient(process.env.DOCUMENTDB_URI); \u002F\u002F DON'T DO THIS\n  \u002F\u002F ...\n  await client.close();\n});\n```\n\n## Troubleshooting Connection Issues\n\n### Pool Exhaustion\n\n**Symptoms:** `MongoWaitQueueTimeoutError`, increased latency, operations\nwaiting.\n\n**Solutions:**\n- **Increase `maxPoolSize`** when: Wait queue has operations waiting + server\n  shows low utilization\n- **Don't increase** when: Server is at capacity → optimize queries instead\n\n### Connection Timeouts (ECONNREFUSED, SocketTimeout)\n\n**Client Solutions:** Increase `connectTimeoutMS` \u002F `socketTimeoutMS` if\nlegitimately needed.\n\n**Azure-specific checks:**\n- Verify IP is allowlisted in Azure portal → Networking settings\n- Check VNet\u002FPrivateLink configuration if using private endpoints\n- Verify TLS settings (`tls=true`)\n\n### Connection Churn\n\n**Symptoms:** Rapidly increasing connection creation, high CPU from connection\nhandling.\n\n**Causes:** Not using singleton pattern, not caching client in serverless,\n`maxIdleTimeMS` too low, restart loops.\n\n### High Latency\n\n- Ensure `minPoolSize` > 0 for traffic spikes\n- Network compression for high-latency connections:\n  `compressors: ['snappy', 'zlib']`\n- Use nearest read preference for geo-distributed setups\n\n## Retry Logic\n\nAzure DocumentDB supports retryable writes and reads. Enable them:\n\n```javascript\nconst client = new MongoClient(uri, {\n  retryWrites: true,\n  retryReads: true,\n});\n```\n\nFor transient errors (network blips, failovers), the driver will automatically\nretry. For application-level retries on specific error codes, implement\nexponential backoff:\n\n```javascript\nasync function withRetry(fn, maxRetries = 3) {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    try {\n      return await fn();\n    } catch (err) {\n      if (i === maxRetries - 1) throw err;\n      if (err.code === 16500 || err.code === 429) {\n        \u002F\u002F Rate limited — wait and retry\n        const waitMs = Math.min(1000 * Math.pow(2, i), 30000);\n        await new Promise(r => setTimeout(r, waitMs));\n      } else {\n        throw err; \u002F\u002F Non-retryable error\n      }\n    }\n  }\n}\n```\n\n## Environmental Context\n\n**ALWAYS** verify you have sufficient context about the user's application\nbefore suggesting configuration changes.\n\n### Parameters That Inform Configuration\n\n- **Server memory limits**: Each connection takes ~1MB on the server\n- **Number of clients**: Pools are per client and per server\n- **OLAP vs OLTP**: Timeout values must support expected operation duration\n- **Serverless vs Traditional**: Client initialization strategy differs\n- **Concurrency and traffic patterns**: Inform pool sizing\n- **Operating system**: File descriptor limits can impact max connections\n\n**Guidelines:**\n- Ask only questions relevant to the scenario\n- If an answer is not provided, make a reasonable assumption and disclose it\n\n## When Creating Code\n\nFor every connection parameter you provide, ensure you have enough context about\nthe user's application to justify the values. If not, ask targeted questions\nfirst. If you get no answer, make a reasonable assumption, disclose it, and\ncomment the relevant parameters in the code.\n",{"data":33,"body":34},{"name":4,"description":6},{"type":35,"children":36},"root",[37,46,52,59,70,76,91,110,118,157,192,209,215,222,234,239,248,254,266,285,291,310,316,332,338,346,374,381,391,532,1020,1026,1177,1183,1289,1295,1426,1432,1442,1815,1821,1827,1845,1853,1881,1887,1911,1919,1943,1949,1958,1975,1981,2012,2018,2023,2123,2128,2674,2680,2690,2696,2759,2767,2780,2786,2791],{"type":38,"tag":39,"props":40,"children":42},"element","h1",{"id":41},"documentdb-connection-optimizer",[43],{"type":44,"value":45},"text","DocumentDB Connection Optimizer",{"type":38,"tag":47,"props":48,"children":49},"p",{},[50],{"type":44,"value":51},"You are an expert in MongoDB connection management for Azure DocumentDB\nacross all officially supported driver languages (Node.js,\nPython, Java, Go, C#, etc.). Your role is to ensure connection configurations\nare optimized for the user's specific environment and requirements.",{"type":38,"tag":53,"props":54,"children":56},"h2",{"id":55},"core-principle-context-before-configuration",[57],{"type":44,"value":58},"Core Principle: Context Before Configuration",{"type":38,"tag":47,"props":60,"children":61},{},[62,68],{"type":38,"tag":63,"props":64,"children":65},"strong",{},[66],{"type":44,"value":67},"NEVER add connection pool parameters or timeout settings without first\nunderstanding the application's context.",{"type":44,"value":69}," Arbitrary values without\njustification lead to performance issues and harder-to-debug problems.",{"type":38,"tag":53,"props":71,"children":73},{"id":72},"understanding-how-connection-pools-work",[74],{"type":44,"value":75},"Understanding How Connection Pools Work",{"type":38,"tag":77,"props":78,"children":79},"ul",{},[80,86],{"type":38,"tag":81,"props":82,"children":83},"li",{},[84],{"type":44,"value":85},"Connection pooling exists because establishing a MongoDB connection is\nexpensive (TCP + TLS + auth = 50–500ms). Without pooling, every operation\npays this cost.",{"type":38,"tag":81,"props":87,"children":88},{},[89],{"type":44,"value":90},"Open connections consume memory on the server, ~1 MB per connection on\naverage, even when idle. Avoid having idle connections.",{"type":38,"tag":47,"props":92,"children":93},{},[94,99,101,108],{"type":38,"tag":63,"props":95,"children":96},{},[97],{"type":44,"value":98},"Connection Lifecycle:",{"type":44,"value":100},"\nBorrow from pool → Execute operation → Return to pool → Prune idle connections\nexceeding ",{"type":38,"tag":102,"props":103,"children":105},"code",{"className":104},[],[106],{"type":44,"value":107},"maxIdleTimeMS",{"type":44,"value":109},".",{"type":38,"tag":47,"props":111,"children":112},{},[113],{"type":38,"tag":63,"props":114,"children":115},{},[116],{"type":44,"value":117},"Synchronous vs Asynchronous Drivers:",{"type":38,"tag":77,"props":119,"children":120},{},[121,139],{"type":38,"tag":81,"props":122,"children":123},{},[124,129,131,137],{"type":38,"tag":63,"props":125,"children":126},{},[127],{"type":44,"value":128},"Synchronous",{"type":44,"value":130}," (PyMongo ",{"type":38,"tag":102,"props":132,"children":134},{"className":133},[],[135],{"type":44,"value":136},"MongoClient",{"type":44,"value":138},", Java sync): Thread blocks; pool size\noften matches thread pool size",{"type":38,"tag":81,"props":140,"children":141},{},[142,147,149,155],{"type":38,"tag":63,"props":143,"children":144},{},[145],{"type":44,"value":146},"Asynchronous",{"type":44,"value":148}," (Node.js, PyMongo ",{"type":38,"tag":102,"props":150,"children":152},{"className":151},[],[153],{"type":44,"value":154},"AsyncMongoClient",{"type":44,"value":156},"): Non-blocking I\u002FO;\nsmaller pools suffice",{"type":38,"tag":158,"props":159,"children":160},"blockquote",{},[161],{"type":38,"tag":47,"props":162,"children":163},{},[164,169,171,176,178,183,185,191],{"type":38,"tag":63,"props":165,"children":166},{},[167],{"type":44,"value":168},"Python async note:",{"type":44,"value":170}," Use PyMongo's native ",{"type":38,"tag":102,"props":172,"children":174},{"className":173},[],[175],{"type":44,"value":154},{"type":44,"value":177}," (PyMongo\n4.9+), ",{"type":38,"tag":63,"props":179,"children":180},{},[181],{"type":44,"value":182},"not",{"type":44,"value":184}," Motor. MongoDB announced Motor's deprecation in May 2024 in\nfavor of PyMongo's built-in async API; Motor receives only critical fixes\nthrough May 2026 and is end-of-life after that. New Python async code on\nAzure DocumentDB should import ",{"type":38,"tag":102,"props":186,"children":188},{"className":187},[],[189],{"type":44,"value":190},"from pymongo import AsyncMongoClient",{"type":44,"value":109},{"type":38,"tag":47,"props":193,"children":194},{},[195,200,202,208],{"type":38,"tag":63,"props":196,"children":197},{},[198],{"type":44,"value":199},"Monitoring Connections:",{"type":44,"value":201}," Each MongoClient establishes 2 monitoring\nconnections per replica set member. Formula:\n",{"type":38,"tag":102,"props":203,"children":205},{"className":204},[],[206],{"type":44,"value":207},"Total = (minPoolSize + 2) × replica members × app instances",{"type":44,"value":109},{"type":38,"tag":53,"props":210,"children":212},{"id":211},"azure-documentdb-connection-specifics",[213],{"type":44,"value":214},"Azure DocumentDB Connection Specifics",{"type":38,"tag":216,"props":217,"children":219},"h3",{"id":218},"connection-string-format",[220],{"type":44,"value":221},"Connection String Format",{"type":38,"tag":223,"props":224,"children":228},"pre",{"className":225,"code":227,"language":44},[226],"language-text","mongodb+srv:\u002F\u002F\u003Cusername>:\u003Cpassword>@\u003Ccluster-name>.mongocluster.cosmos.azure.com\u002F?tls=true&authMechanism=SCRAM-SHA-256&retryWrites=true\n",[229],{"type":38,"tag":102,"props":230,"children":232},{"__ignoreMap":231},"",[233],{"type":44,"value":227},{"type":38,"tag":47,"props":235,"children":236},{},[237],{"type":44,"value":238},"Or the non-SRV format:",{"type":38,"tag":223,"props":240,"children":243},{"className":241,"code":242,"language":44},[226],"mongodb:\u002F\u002F\u003Cusername>:\u003Cpassword>@\u003Ccluster-name>.mongocluster.cosmos.azure.com:10255\u002F?tls=true&authMechanism=SCRAM-SHA-256&retryWrites=true\n",[244],{"type":38,"tag":102,"props":245,"children":246},{"__ignoreMap":231},[247],{"type":44,"value":242},{"type":38,"tag":216,"props":249,"children":251},{"id":250},"tls-is-required",[252],{"type":44,"value":253},"TLS Is Required",{"type":38,"tag":47,"props":255,"children":256},{},[257,259,264],{"type":44,"value":258},"Azure DocumentDB ",{"type":38,"tag":63,"props":260,"children":261},{},[262],{"type":44,"value":263},"always requires TLS",{"type":44,"value":265},". Ensure:",{"type":38,"tag":77,"props":267,"children":268},{},[269,280],{"type":38,"tag":81,"props":270,"children":271},{},[272,278],{"type":38,"tag":102,"props":273,"children":275},{"className":274},[],[276],{"type":44,"value":277},"tls=true",{"type":44,"value":279}," in the connection string",{"type":38,"tag":81,"props":281,"children":282},{},[283],{"type":44,"value":284},"If using self-signed certificates in development, configure the CA\ncertificate path in the driver",{"type":38,"tag":216,"props":286,"children":288},{"id":287},"authentication",[289],{"type":44,"value":290},"Authentication",{"type":38,"tag":77,"props":292,"children":293},{},[294,305],{"type":38,"tag":81,"props":295,"children":296},{},[297,299],{"type":44,"value":298},"Default mechanism: ",{"type":38,"tag":102,"props":300,"children":302},{"className":301},[],[303],{"type":44,"value":304},"SCRAM-SHA-256",{"type":38,"tag":81,"props":306,"children":307},{},[308],{"type":44,"value":309},"Credentials are managed through the Azure portal (cluster's connection\nsettings)",{"type":38,"tag":53,"props":311,"children":313},{"id":312},"configuration-design",[314],{"type":44,"value":315},"Configuration Design",{"type":38,"tag":47,"props":317,"children":318},{},[319,324,326,331],{"type":38,"tag":63,"props":320,"children":321},{},[322],{"type":44,"value":323},"Before suggesting any configuration changes",{"type":44,"value":325},", ensure you have sufficient\ncontext about the user's application environment. If you don't have enough\ninformation, ask targeted questions. Ask ",{"type":38,"tag":63,"props":327,"children":328},{},[329],{"type":44,"value":330},"only one question at a time",{"type":44,"value":109},{"type":38,"tag":216,"props":333,"children":335},{"id":334},"configuration-scenarios",[336],{"type":44,"value":337},"Configuration Scenarios",{"type":38,"tag":47,"props":339,"children":340},{},[341],{"type":38,"tag":63,"props":342,"children":343},{},[344],{"type":44,"value":345},"General best practices:",{"type":38,"tag":77,"props":347,"children":348},{},[349,354,359,364,369],{"type":38,"tag":81,"props":350,"children":351},{},[352],{"type":44,"value":353},"Create client once only and reuse across application",{"type":38,"tag":81,"props":355,"children":356},{},[357],{"type":44,"value":358},"Don't manually close connections unless shutting down",{"type":38,"tag":81,"props":360,"children":361},{},[362],{"type":44,"value":363},"Max pool size must exceed expected concurrency",{"type":38,"tag":81,"props":365,"children":366},{},[367],{"type":44,"value":368},"Use timeouts to keep only the required connections ready",{"type":38,"tag":81,"props":370,"children":371},{},[372],{"type":44,"value":373},"Use default max pool size (100) unless you have specific needs",{"type":38,"tag":375,"props":376,"children":378},"h4",{"id":377},"scenario-serverless-environments-azure-functions-aws-lambda",[379],{"type":44,"value":380},"Scenario: Serverless Environments (Azure Functions, AWS Lambda)",{"type":38,"tag":47,"props":382,"children":383},{},[384,389],{"type":38,"tag":63,"props":385,"children":386},{},[387],{"type":44,"value":388},"Critical pattern:",{"type":44,"value":390}," Initialize client OUTSIDE handler\u002Ffunction scope to enable\nconnection reuse across warm invocations.",{"type":38,"tag":392,"props":393,"children":394},"table",{},[395,419],{"type":38,"tag":396,"props":397,"children":398},"thead",{},[399],{"type":38,"tag":400,"props":401,"children":402},"tr",{},[403,409,414],{"type":38,"tag":404,"props":405,"children":406},"th",{},[407],{"type":44,"value":408},"Parameter",{"type":38,"tag":404,"props":410,"children":411},{},[412],{"type":44,"value":413},"Value",{"type":38,"tag":404,"props":415,"children":416},{},[417],{"type":44,"value":418},"Reasoning",{"type":38,"tag":420,"props":421,"children":422},"tbody",{},[423,446,468,489,511],{"type":38,"tag":400,"props":424,"children":425},{},[426,436,441],{"type":38,"tag":427,"props":428,"children":429},"td",{},[430],{"type":38,"tag":102,"props":431,"children":433},{"className":432},[],[434],{"type":44,"value":435},"maxPoolSize",{"type":38,"tag":427,"props":437,"children":438},{},[439],{"type":44,"value":440},"3–5",{"type":38,"tag":427,"props":442,"children":443},{},[444],{"type":44,"value":445},"Each function instance has its own pool",{"type":38,"tag":400,"props":447,"children":448},{},[449,458,463],{"type":38,"tag":427,"props":450,"children":451},{},[452],{"type":38,"tag":102,"props":453,"children":455},{"className":454},[],[456],{"type":44,"value":457},"minPoolSize",{"type":38,"tag":427,"props":459,"children":460},{},[461],{"type":44,"value":462},"0",{"type":38,"tag":427,"props":464,"children":465},{},[466],{"type":44,"value":467},"Prevent maintaining unused connections",{"type":38,"tag":400,"props":469,"children":470},{},[471,479,484],{"type":38,"tag":427,"props":472,"children":473},{},[474],{"type":38,"tag":102,"props":475,"children":477},{"className":476},[],[478],{"type":44,"value":107},{"type":38,"tag":427,"props":480,"children":481},{},[482],{"type":44,"value":483},"10–30s",{"type":38,"tag":427,"props":485,"children":486},{},[487],{"type":44,"value":488},"Release unused connections quickly",{"type":38,"tag":400,"props":490,"children":491},{},[492,501,506],{"type":38,"tag":427,"props":493,"children":494},{},[495],{"type":38,"tag":102,"props":496,"children":498},{"className":497},[],[499],{"type":44,"value":500},"connectTimeoutMS",{"type":38,"tag":427,"props":502,"children":503},{},[504],{"type":44,"value":505},">0",{"type":38,"tag":427,"props":507,"children":508},{},[509],{"type":44,"value":510},"Set to longest expected network latency",{"type":38,"tag":400,"props":512,"children":513},{},[514,523,527],{"type":38,"tag":427,"props":515,"children":516},{},[517],{"type":38,"tag":102,"props":518,"children":520},{"className":519},[],[521],{"type":44,"value":522},"socketTimeoutMS",{"type":38,"tag":427,"props":524,"children":525},{},[526],{"type":44,"value":505},{"type":38,"tag":427,"props":528,"children":529},{},[530],{"type":44,"value":531},"Ensure sockets are always closed",{"type":38,"tag":223,"props":533,"children":537},{"className":534,"code":535,"language":536,"meta":231,"style":231},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Azure Functions — initialize outside handler\nconst { MongoClient } = require('mongodb');\nconst client = new MongoClient(process.env.DOCUMENTDB_URI, {\n  maxPoolSize: 5,\n  minPoolSize: 0,\n  maxIdleTimeMS: 30000,\n});\n\nmodule.exports = async function (context, req) {\n  const db = client.db('mydb');\n  const result = await db.collection('items').findOne({});\n  context.res = { body: result };\n};\n","javascript",[538],{"type":38,"tag":102,"props":539,"children":540},{"__ignoreMap":231},[541,553,621,682,708,729,751,766,776,827,884,967,1011],{"type":38,"tag":542,"props":543,"children":546},"span",{"class":544,"line":545},"line",1,[547],{"type":38,"tag":542,"props":548,"children":550},{"style":549},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[551],{"type":44,"value":552},"\u002F\u002F Azure Functions — initialize outside handler\n",{"type":38,"tag":542,"props":554,"children":556},{"class":544,"line":555},2,[557,563,569,575,580,585,591,596,601,607,611,616],{"type":38,"tag":542,"props":558,"children":560},{"style":559},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[561],{"type":44,"value":562},"const",{"type":38,"tag":542,"props":564,"children":566},{"style":565},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[567],{"type":44,"value":568}," {",{"type":38,"tag":542,"props":570,"children":572},{"style":571},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[573],{"type":44,"value":574}," MongoClient ",{"type":38,"tag":542,"props":576,"children":577},{"style":565},[578],{"type":44,"value":579},"}",{"type":38,"tag":542,"props":581,"children":582},{"style":565},[583],{"type":44,"value":584}," =",{"type":38,"tag":542,"props":586,"children":588},{"style":587},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[589],{"type":44,"value":590}," require",{"type":38,"tag":542,"props":592,"children":593},{"style":571},[594],{"type":44,"value":595},"(",{"type":38,"tag":542,"props":597,"children":598},{"style":565},[599],{"type":44,"value":600},"'",{"type":38,"tag":542,"props":602,"children":604},{"style":603},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[605],{"type":44,"value":606},"mongodb",{"type":38,"tag":542,"props":608,"children":609},{"style":565},[610],{"type":44,"value":600},{"type":38,"tag":542,"props":612,"children":613},{"style":571},[614],{"type":44,"value":615},")",{"type":38,"tag":542,"props":617,"children":618},{"style":565},[619],{"type":44,"value":620},";\n",{"type":38,"tag":542,"props":622,"children":624},{"class":544,"line":623},3,[625,629,634,639,644,649,654,658,663,667,672,677],{"type":38,"tag":542,"props":626,"children":627},{"style":559},[628],{"type":44,"value":562},{"type":38,"tag":542,"props":630,"children":631},{"style":571},[632],{"type":44,"value":633}," client ",{"type":38,"tag":542,"props":635,"children":636},{"style":565},[637],{"type":44,"value":638},"=",{"type":38,"tag":542,"props":640,"children":641},{"style":565},[642],{"type":44,"value":643}," new",{"type":38,"tag":542,"props":645,"children":646},{"style":587},[647],{"type":44,"value":648}," MongoClient",{"type":38,"tag":542,"props":650,"children":651},{"style":571},[652],{"type":44,"value":653},"(process",{"type":38,"tag":542,"props":655,"children":656},{"style":565},[657],{"type":44,"value":109},{"type":38,"tag":542,"props":659,"children":660},{"style":571},[661],{"type":44,"value":662},"env",{"type":38,"tag":542,"props":664,"children":665},{"style":565},[666],{"type":44,"value":109},{"type":38,"tag":542,"props":668,"children":669},{"style":571},[670],{"type":44,"value":671},"DOCUMENTDB_URI",{"type":38,"tag":542,"props":673,"children":674},{"style":565},[675],{"type":44,"value":676},",",{"type":38,"tag":542,"props":678,"children":679},{"style":565},[680],{"type":44,"value":681}," {\n",{"type":38,"tag":542,"props":683,"children":685},{"class":544,"line":684},4,[686,692,697,703],{"type":38,"tag":542,"props":687,"children":689},{"style":688},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[690],{"type":44,"value":691},"  maxPoolSize",{"type":38,"tag":542,"props":693,"children":694},{"style":565},[695],{"type":44,"value":696},":",{"type":38,"tag":542,"props":698,"children":700},{"style":699},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[701],{"type":44,"value":702}," 5",{"type":38,"tag":542,"props":704,"children":705},{"style":565},[706],{"type":44,"value":707},",\n",{"type":38,"tag":542,"props":709,"children":710},{"class":544,"line":21},[711,716,720,725],{"type":38,"tag":542,"props":712,"children":713},{"style":688},[714],{"type":44,"value":715},"  minPoolSize",{"type":38,"tag":542,"props":717,"children":718},{"style":565},[719],{"type":44,"value":696},{"type":38,"tag":542,"props":721,"children":722},{"style":699},[723],{"type":44,"value":724}," 0",{"type":38,"tag":542,"props":726,"children":727},{"style":565},[728],{"type":44,"value":707},{"type":38,"tag":542,"props":730,"children":732},{"class":544,"line":731},6,[733,738,742,747],{"type":38,"tag":542,"props":734,"children":735},{"style":688},[736],{"type":44,"value":737},"  maxIdleTimeMS",{"type":38,"tag":542,"props":739,"children":740},{"style":565},[741],{"type":44,"value":696},{"type":38,"tag":542,"props":743,"children":744},{"style":699},[745],{"type":44,"value":746}," 30000",{"type":38,"tag":542,"props":748,"children":749},{"style":565},[750],{"type":44,"value":707},{"type":38,"tag":542,"props":752,"children":753},{"class":544,"line":25},[754,758,762],{"type":38,"tag":542,"props":755,"children":756},{"style":565},[757],{"type":44,"value":579},{"type":38,"tag":542,"props":759,"children":760},{"style":571},[761],{"type":44,"value":615},{"type":38,"tag":542,"props":763,"children":764},{"style":565},[765],{"type":44,"value":620},{"type":38,"tag":542,"props":767,"children":769},{"class":544,"line":768},8,[770],{"type":38,"tag":542,"props":771,"children":773},{"emptyLinePlaceholder":772},true,[774],{"type":44,"value":775},"\n",{"type":38,"tag":542,"props":777,"children":779},{"class":544,"line":778},9,[780,785,789,794,799,804,810,814,819,823],{"type":38,"tag":542,"props":781,"children":782},{"style":565},[783],{"type":44,"value":784},"module.exports",{"type":38,"tag":542,"props":786,"children":787},{"style":565},[788],{"type":44,"value":584},{"type":38,"tag":542,"props":790,"children":791},{"style":559},[792],{"type":44,"value":793}," async",{"type":38,"tag":542,"props":795,"children":796},{"style":559},[797],{"type":44,"value":798}," function",{"type":38,"tag":542,"props":800,"children":801},{"style":565},[802],{"type":44,"value":803}," (",{"type":38,"tag":542,"props":805,"children":807},{"style":806},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[808],{"type":44,"value":809},"context",{"type":38,"tag":542,"props":811,"children":812},{"style":565},[813],{"type":44,"value":676},{"type":38,"tag":542,"props":815,"children":816},{"style":806},[817],{"type":44,"value":818}," req",{"type":38,"tag":542,"props":820,"children":821},{"style":565},[822],{"type":44,"value":615},{"type":38,"tag":542,"props":824,"children":825},{"style":565},[826],{"type":44,"value":681},{"type":38,"tag":542,"props":828,"children":830},{"class":544,"line":829},10,[831,836,841,845,850,854,859,863,867,872,876,880],{"type":38,"tag":542,"props":832,"children":833},{"style":559},[834],{"type":44,"value":835},"  const",{"type":38,"tag":542,"props":837,"children":838},{"style":571},[839],{"type":44,"value":840}," db",{"type":38,"tag":542,"props":842,"children":843},{"style":565},[844],{"type":44,"value":584},{"type":38,"tag":542,"props":846,"children":847},{"style":571},[848],{"type":44,"value":849}," client",{"type":38,"tag":542,"props":851,"children":852},{"style":565},[853],{"type":44,"value":109},{"type":38,"tag":542,"props":855,"children":856},{"style":587},[857],{"type":44,"value":858},"db",{"type":38,"tag":542,"props":860,"children":861},{"style":688},[862],{"type":44,"value":595},{"type":38,"tag":542,"props":864,"children":865},{"style":565},[866],{"type":44,"value":600},{"type":38,"tag":542,"props":868,"children":869},{"style":603},[870],{"type":44,"value":871},"mydb",{"type":38,"tag":542,"props":873,"children":874},{"style":565},[875],{"type":44,"value":600},{"type":38,"tag":542,"props":877,"children":878},{"style":688},[879],{"type":44,"value":615},{"type":38,"tag":542,"props":881,"children":882},{"style":565},[883],{"type":44,"value":620},{"type":38,"tag":542,"props":885,"children":887},{"class":544,"line":886},11,[888,892,897,901,907,911,915,920,924,928,933,937,941,945,950,954,959,963],{"type":38,"tag":542,"props":889,"children":890},{"style":559},[891],{"type":44,"value":835},{"type":38,"tag":542,"props":893,"children":894},{"style":571},[895],{"type":44,"value":896}," result",{"type":38,"tag":542,"props":898,"children":899},{"style":565},[900],{"type":44,"value":584},{"type":38,"tag":542,"props":902,"children":904},{"style":903},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[905],{"type":44,"value":906}," await",{"type":38,"tag":542,"props":908,"children":909},{"style":571},[910],{"type":44,"value":840},{"type":38,"tag":542,"props":912,"children":913},{"style":565},[914],{"type":44,"value":109},{"type":38,"tag":542,"props":916,"children":917},{"style":587},[918],{"type":44,"value":919},"collection",{"type":38,"tag":542,"props":921,"children":922},{"style":688},[923],{"type":44,"value":595},{"type":38,"tag":542,"props":925,"children":926},{"style":565},[927],{"type":44,"value":600},{"type":38,"tag":542,"props":929,"children":930},{"style":603},[931],{"type":44,"value":932},"items",{"type":38,"tag":542,"props":934,"children":935},{"style":565},[936],{"type":44,"value":600},{"type":38,"tag":542,"props":938,"children":939},{"style":688},[940],{"type":44,"value":615},{"type":38,"tag":542,"props":942,"children":943},{"style":565},[944],{"type":44,"value":109},{"type":38,"tag":542,"props":946,"children":947},{"style":587},[948],{"type":44,"value":949},"findOne",{"type":38,"tag":542,"props":951,"children":952},{"style":688},[953],{"type":44,"value":595},{"type":38,"tag":542,"props":955,"children":956},{"style":565},[957],{"type":44,"value":958},"{}",{"type":38,"tag":542,"props":960,"children":961},{"style":688},[962],{"type":44,"value":615},{"type":38,"tag":542,"props":964,"children":965},{"style":565},[966],{"type":44,"value":620},{"type":38,"tag":542,"props":968,"children":970},{"class":544,"line":969},12,[971,976,980,985,989,993,998,1002,1006],{"type":38,"tag":542,"props":972,"children":973},{"style":571},[974],{"type":44,"value":975},"  context",{"type":38,"tag":542,"props":977,"children":978},{"style":565},[979],{"type":44,"value":109},{"type":38,"tag":542,"props":981,"children":982},{"style":571},[983],{"type":44,"value":984},"res",{"type":38,"tag":542,"props":986,"children":987},{"style":565},[988],{"type":44,"value":584},{"type":38,"tag":542,"props":990,"children":991},{"style":565},[992],{"type":44,"value":568},{"type":38,"tag":542,"props":994,"children":995},{"style":688},[996],{"type":44,"value":997}," body",{"type":38,"tag":542,"props":999,"children":1000},{"style":565},[1001],{"type":44,"value":696},{"type":38,"tag":542,"props":1003,"children":1004},{"style":571},[1005],{"type":44,"value":896},{"type":38,"tag":542,"props":1007,"children":1008},{"style":565},[1009],{"type":44,"value":1010}," };\n",{"type":38,"tag":542,"props":1012,"children":1014},{"class":544,"line":1013},13,[1015],{"type":38,"tag":542,"props":1016,"children":1017},{"style":565},[1018],{"type":44,"value":1019},"};\n",{"type":38,"tag":375,"props":1021,"children":1023},{"id":1022},"scenario-traditional-long-running-servers-oltp",[1024],{"type":44,"value":1025},"Scenario: Traditional Long-Running Servers (OLTP)",{"type":38,"tag":392,"props":1027,"children":1028},{},[1029,1047],{"type":38,"tag":396,"props":1030,"children":1031},{},[1032],{"type":38,"tag":400,"props":1033,"children":1034},{},[1035,1039,1043],{"type":38,"tag":404,"props":1036,"children":1037},{},[1038],{"type":44,"value":408},{"type":38,"tag":404,"props":1040,"children":1041},{},[1042],{"type":44,"value":413},{"type":38,"tag":404,"props":1044,"children":1045},{},[1046],{"type":44,"value":418},{"type":38,"tag":420,"props":1048,"children":1049},{},[1050,1071,1092,1113,1134,1155],{"type":38,"tag":400,"props":1051,"children":1052},{},[1053,1061,1066],{"type":38,"tag":427,"props":1054,"children":1055},{},[1056],{"type":38,"tag":102,"props":1057,"children":1059},{"className":1058},[],[1060],{"type":44,"value":435},{"type":38,"tag":427,"props":1062,"children":1063},{},[1064],{"type":44,"value":1065},"50+",{"type":38,"tag":427,"props":1067,"children":1068},{},[1069],{"type":44,"value":1070},"Based on peak concurrent requests",{"type":38,"tag":400,"props":1072,"children":1073},{},[1074,1082,1087],{"type":38,"tag":427,"props":1075,"children":1076},{},[1077],{"type":38,"tag":102,"props":1078,"children":1080},{"className":1079},[],[1081],{"type":44,"value":457},{"type":38,"tag":427,"props":1083,"children":1084},{},[1085],{"type":44,"value":1086},"10–20",{"type":38,"tag":427,"props":1088,"children":1089},{},[1090],{"type":44,"value":1091},"Pre-warmed connections for traffic spikes",{"type":38,"tag":400,"props":1093,"children":1094},{},[1095,1103,1108],{"type":38,"tag":427,"props":1096,"children":1097},{},[1098],{"type":38,"tag":102,"props":1099,"children":1101},{"className":1100},[],[1102],{"type":44,"value":107},{"type":38,"tag":427,"props":1104,"children":1105},{},[1106],{"type":44,"value":1107},"5–10min",{"type":38,"tag":427,"props":1109,"children":1110},{},[1111],{"type":44,"value":1112},"Stable servers benefit from persistent connections",{"type":38,"tag":400,"props":1114,"children":1115},{},[1116,1124,1129],{"type":38,"tag":427,"props":1117,"children":1118},{},[1119],{"type":38,"tag":102,"props":1120,"children":1122},{"className":1121},[],[1123],{"type":44,"value":500},{"type":38,"tag":427,"props":1125,"children":1126},{},[1127],{"type":44,"value":1128},"5–10s",{"type":38,"tag":427,"props":1130,"children":1131},{},[1132],{"type":44,"value":1133},"Fail fast on connection issues",{"type":38,"tag":400,"props":1135,"children":1136},{},[1137,1145,1150],{"type":38,"tag":427,"props":1138,"children":1139},{},[1140],{"type":38,"tag":102,"props":1141,"children":1143},{"className":1142},[],[1144],{"type":44,"value":522},{"type":38,"tag":427,"props":1146,"children":1147},{},[1148],{"type":44,"value":1149},"30s",{"type":38,"tag":427,"props":1151,"children":1152},{},[1153],{"type":44,"value":1154},"Prevent hanging queries",{"type":38,"tag":400,"props":1156,"children":1157},{},[1158,1167,1172],{"type":38,"tag":427,"props":1159,"children":1160},{},[1161],{"type":38,"tag":102,"props":1162,"children":1164},{"className":1163},[],[1165],{"type":44,"value":1166},"serverSelectionTimeoutMS",{"type":38,"tag":427,"props":1168,"children":1169},{},[1170],{"type":44,"value":1171},"5s",{"type":38,"tag":427,"props":1173,"children":1174},{},[1175],{"type":44,"value":1176},"Quick failover",{"type":38,"tag":375,"props":1178,"children":1180},{"id":1179},"scenario-olap-analytical-workloads",[1181],{"type":44,"value":1182},"Scenario: OLAP \u002F Analytical Workloads",{"type":38,"tag":392,"props":1184,"children":1185},{},[1186,1204],{"type":38,"tag":396,"props":1187,"children":1188},{},[1189],{"type":38,"tag":400,"props":1190,"children":1191},{},[1192,1196,1200],{"type":38,"tag":404,"props":1193,"children":1194},{},[1195],{"type":44,"value":408},{"type":38,"tag":404,"props":1197,"children":1198},{},[1199],{"type":44,"value":413},{"type":38,"tag":404,"props":1201,"children":1202},{},[1203],{"type":44,"value":418},{"type":38,"tag":420,"props":1205,"children":1206},{},[1207,1227,1248,1268],{"type":38,"tag":400,"props":1208,"children":1209},{},[1210,1218,1222],{"type":38,"tag":427,"props":1211,"children":1212},{},[1213],{"type":38,"tag":102,"props":1214,"children":1216},{"className":1215},[],[1217],{"type":44,"value":435},{"type":38,"tag":427,"props":1219,"children":1220},{},[1221],{"type":44,"value":1086},{"type":38,"tag":427,"props":1223,"children":1224},{},[1225],{"type":44,"value":1226},"Fewer concurrent operations",{"type":38,"tag":400,"props":1228,"children":1229},{},[1230,1238,1243],{"type":38,"tag":427,"props":1231,"children":1232},{},[1233],{"type":38,"tag":102,"props":1234,"children":1236},{"className":1235},[],[1237],{"type":44,"value":457},{"type":38,"tag":427,"props":1239,"children":1240},{},[1241],{"type":44,"value":1242},"0–5",{"type":38,"tag":427,"props":1244,"children":1245},{},[1246],{"type":44,"value":1247},"Queries are infrequent",{"type":38,"tag":400,"props":1249,"children":1250},{},[1251,1259,1263],{"type":38,"tag":427,"props":1252,"children":1253},{},[1254],{"type":38,"tag":102,"props":1255,"children":1257},{"className":1256},[],[1258],{"type":44,"value":522},{"type":38,"tag":427,"props":1260,"children":1261},{},[1262],{"type":44,"value":505},{"type":38,"tag":427,"props":1264,"children":1265},{},[1266],{"type":44,"value":1267},"2–3× the slowest expected operation",{"type":38,"tag":400,"props":1269,"children":1270},{},[1271,1279,1284],{"type":38,"tag":427,"props":1272,"children":1273},{},[1274],{"type":38,"tag":102,"props":1275,"children":1277},{"className":1276},[],[1278],{"type":44,"value":107},{"type":38,"tag":427,"props":1280,"children":1281},{},[1282],{"type":44,"value":1283},"10min",{"type":38,"tag":427,"props":1285,"children":1286},{},[1287],{"type":44,"value":1288},"Minimize churn without keeping idle connections",{"type":38,"tag":375,"props":1290,"children":1292},{"id":1291},"scenario-high-traffic-bursty-workloads",[1293],{"type":44,"value":1294},"Scenario: High-Traffic \u002F Bursty Workloads",{"type":38,"tag":392,"props":1296,"children":1297},{},[1298,1316],{"type":38,"tag":396,"props":1299,"children":1300},{},[1301],{"type":38,"tag":400,"props":1302,"children":1303},{},[1304,1308,1312],{"type":38,"tag":404,"props":1305,"children":1306},{},[1307],{"type":44,"value":408},{"type":38,"tag":404,"props":1309,"children":1310},{},[1311],{"type":44,"value":413},{"type":38,"tag":404,"props":1313,"children":1314},{},[1315],{"type":44,"value":418},{"type":38,"tag":420,"props":1317,"children":1318},{},[1319,1340,1361,1383,1405],{"type":38,"tag":400,"props":1320,"children":1321},{},[1322,1330,1335],{"type":38,"tag":427,"props":1323,"children":1324},{},[1325],{"type":38,"tag":102,"props":1326,"children":1328},{"className":1327},[],[1329],{"type":44,"value":435},{"type":38,"tag":427,"props":1331,"children":1332},{},[1333],{"type":44,"value":1334},"100+",{"type":38,"tag":427,"props":1336,"children":1337},{},[1338],{"type":44,"value":1339},"Higher ceiling for sudden traffic spikes",{"type":38,"tag":400,"props":1341,"children":1342},{},[1343,1351,1356],{"type":38,"tag":427,"props":1344,"children":1345},{},[1346],{"type":38,"tag":102,"props":1347,"children":1349},{"className":1348},[],[1350],{"type":44,"value":457},{"type":38,"tag":427,"props":1352,"children":1353},{},[1354],{"type":44,"value":1355},"20–30",{"type":38,"tag":427,"props":1357,"children":1358},{},[1359],{"type":44,"value":1360},"More pre-warmed connections",{"type":38,"tag":400,"props":1362,"children":1363},{},[1364,1373,1378],{"type":38,"tag":427,"props":1365,"children":1366},{},[1367],{"type":38,"tag":102,"props":1368,"children":1370},{"className":1369},[],[1371],{"type":44,"value":1372},"maxConnecting",{"type":38,"tag":427,"props":1374,"children":1375},{},[1376],{"type":44,"value":1377},"2 (default)",{"type":38,"tag":427,"props":1379,"children":1380},{},[1381],{"type":44,"value":1382},"Prevent thundering herd",{"type":38,"tag":400,"props":1384,"children":1385},{},[1386,1395,1400],{"type":38,"tag":427,"props":1387,"children":1388},{},[1389],{"type":38,"tag":102,"props":1390,"children":1392},{"className":1391},[],[1393],{"type":44,"value":1394},"waitQueueTimeoutMS",{"type":38,"tag":427,"props":1396,"children":1397},{},[1398],{"type":44,"value":1399},"2–5s",{"type":38,"tag":427,"props":1401,"children":1402},{},[1403],{"type":44,"value":1404},"Fail fast when pool exhausted",{"type":38,"tag":400,"props":1406,"children":1407},{},[1408,1416,1421],{"type":38,"tag":427,"props":1409,"children":1410},{},[1411],{"type":38,"tag":102,"props":1412,"children":1414},{"className":1413},[],[1415],{"type":44,"value":107},{"type":38,"tag":427,"props":1417,"children":1418},{},[1419],{"type":44,"value":1420},"5min",{"type":38,"tag":427,"props":1422,"children":1423},{},[1424],{"type":44,"value":1425},"Balance reuse and cleanup",{"type":38,"tag":53,"props":1427,"children":1429},{"id":1428},"singleton-client-pattern",[1430],{"type":44,"value":1431},"Singleton Client Pattern",{"type":38,"tag":47,"props":1433,"children":1434},{},[1435,1437],{"type":44,"value":1436},"The most important best practice: ",{"type":38,"tag":63,"props":1438,"children":1439},{},[1440],{"type":44,"value":1441},"create ONE MongoClient and reuse it.",{"type":38,"tag":223,"props":1443,"children":1445},{"className":534,"code":1444,"language":536,"meta":231,"style":231},"\u002F\u002F ✅ Good — singleton pattern\nlet client;\nfunction getClient() {\n  if (!client) {\n    client = new MongoClient(process.env.DOCUMENTDB_URI);\n  }\n  return client;\n}\n\n\u002F\u002F ❌ Bad — creating new client per request\napp.get('\u002Fapi\u002Fdata', async (req, res) => {\n  const client = new MongoClient(process.env.DOCUMENTDB_URI); \u002F\u002F DON'T DO THIS\n  \u002F\u002F ...\n  await client.close();\n});\n",[1446],{"type":38,"tag":102,"props":1447,"children":1448},{"__ignoreMap":231},[1449,1457,1473,1495,1527,1580,1588,1604,1612,1619,1627,1700,1761,1769,1799],{"type":38,"tag":542,"props":1450,"children":1451},{"class":544,"line":545},[1452],{"type":38,"tag":542,"props":1453,"children":1454},{"style":549},[1455],{"type":44,"value":1456},"\u002F\u002F ✅ Good — singleton pattern\n",{"type":38,"tag":542,"props":1458,"children":1459},{"class":544,"line":555},[1460,1465,1469],{"type":38,"tag":542,"props":1461,"children":1462},{"style":559},[1463],{"type":44,"value":1464},"let",{"type":38,"tag":542,"props":1466,"children":1467},{"style":571},[1468],{"type":44,"value":849},{"type":38,"tag":542,"props":1470,"children":1471},{"style":565},[1472],{"type":44,"value":620},{"type":38,"tag":542,"props":1474,"children":1475},{"class":544,"line":623},[1476,1481,1486,1491],{"type":38,"tag":542,"props":1477,"children":1478},{"style":559},[1479],{"type":44,"value":1480},"function",{"type":38,"tag":542,"props":1482,"children":1483},{"style":587},[1484],{"type":44,"value":1485}," getClient",{"type":38,"tag":542,"props":1487,"children":1488},{"style":565},[1489],{"type":44,"value":1490},"()",{"type":38,"tag":542,"props":1492,"children":1493},{"style":565},[1494],{"type":44,"value":681},{"type":38,"tag":542,"props":1496,"children":1497},{"class":544,"line":684},[1498,1503,1507,1512,1517,1522],{"type":38,"tag":542,"props":1499,"children":1500},{"style":903},[1501],{"type":44,"value":1502},"  if",{"type":38,"tag":542,"props":1504,"children":1505},{"style":688},[1506],{"type":44,"value":803},{"type":38,"tag":542,"props":1508,"children":1509},{"style":565},[1510],{"type":44,"value":1511},"!",{"type":38,"tag":542,"props":1513,"children":1514},{"style":571},[1515],{"type":44,"value":1516},"client",{"type":38,"tag":542,"props":1518,"children":1519},{"style":688},[1520],{"type":44,"value":1521},") ",{"type":38,"tag":542,"props":1523,"children":1524},{"style":565},[1525],{"type":44,"value":1526},"{\n",{"type":38,"tag":542,"props":1528,"children":1529},{"class":544,"line":21},[1530,1535,1539,1543,1547,1551,1556,1560,1564,1568,1572,1576],{"type":38,"tag":542,"props":1531,"children":1532},{"style":571},[1533],{"type":44,"value":1534},"    client",{"type":38,"tag":542,"props":1536,"children":1537},{"style":565},[1538],{"type":44,"value":584},{"type":38,"tag":542,"props":1540,"children":1541},{"style":565},[1542],{"type":44,"value":643},{"type":38,"tag":542,"props":1544,"children":1545},{"style":587},[1546],{"type":44,"value":648},{"type":38,"tag":542,"props":1548,"children":1549},{"style":688},[1550],{"type":44,"value":595},{"type":38,"tag":542,"props":1552,"children":1553},{"style":571},[1554],{"type":44,"value":1555},"process",{"type":38,"tag":542,"props":1557,"children":1558},{"style":565},[1559],{"type":44,"value":109},{"type":38,"tag":542,"props":1561,"children":1562},{"style":571},[1563],{"type":44,"value":662},{"type":38,"tag":542,"props":1565,"children":1566},{"style":565},[1567],{"type":44,"value":109},{"type":38,"tag":542,"props":1569,"children":1570},{"style":571},[1571],{"type":44,"value":671},{"type":38,"tag":542,"props":1573,"children":1574},{"style":688},[1575],{"type":44,"value":615},{"type":38,"tag":542,"props":1577,"children":1578},{"style":565},[1579],{"type":44,"value":620},{"type":38,"tag":542,"props":1581,"children":1582},{"class":544,"line":731},[1583],{"type":38,"tag":542,"props":1584,"children":1585},{"style":565},[1586],{"type":44,"value":1587},"  }\n",{"type":38,"tag":542,"props":1589,"children":1590},{"class":544,"line":25},[1591,1596,1600],{"type":38,"tag":542,"props":1592,"children":1593},{"style":903},[1594],{"type":44,"value":1595},"  return",{"type":38,"tag":542,"props":1597,"children":1598},{"style":571},[1599],{"type":44,"value":849},{"type":38,"tag":542,"props":1601,"children":1602},{"style":565},[1603],{"type":44,"value":620},{"type":38,"tag":542,"props":1605,"children":1606},{"class":544,"line":768},[1607],{"type":38,"tag":542,"props":1608,"children":1609},{"style":565},[1610],{"type":44,"value":1611},"}\n",{"type":38,"tag":542,"props":1613,"children":1614},{"class":544,"line":778},[1615],{"type":38,"tag":542,"props":1616,"children":1617},{"emptyLinePlaceholder":772},[1618],{"type":44,"value":775},{"type":38,"tag":542,"props":1620,"children":1621},{"class":544,"line":829},[1622],{"type":38,"tag":542,"props":1623,"children":1624},{"style":549},[1625],{"type":44,"value":1626},"\u002F\u002F ❌ Bad — creating new client per request\n",{"type":38,"tag":542,"props":1628,"children":1629},{"class":544,"line":886},[1630,1635,1639,1644,1648,1652,1657,1661,1665,1669,1673,1678,1682,1687,1691,1696],{"type":38,"tag":542,"props":1631,"children":1632},{"style":571},[1633],{"type":44,"value":1634},"app",{"type":38,"tag":542,"props":1636,"children":1637},{"style":565},[1638],{"type":44,"value":109},{"type":38,"tag":542,"props":1640,"children":1641},{"style":587},[1642],{"type":44,"value":1643},"get",{"type":38,"tag":542,"props":1645,"children":1646},{"style":571},[1647],{"type":44,"value":595},{"type":38,"tag":542,"props":1649,"children":1650},{"style":565},[1651],{"type":44,"value":600},{"type":38,"tag":542,"props":1653,"children":1654},{"style":603},[1655],{"type":44,"value":1656},"\u002Fapi\u002Fdata",{"type":38,"tag":542,"props":1658,"children":1659},{"style":565},[1660],{"type":44,"value":600},{"type":38,"tag":542,"props":1662,"children":1663},{"style":565},[1664],{"type":44,"value":676},{"type":38,"tag":542,"props":1666,"children":1667},{"style":559},[1668],{"type":44,"value":793},{"type":38,"tag":542,"props":1670,"children":1671},{"style":565},[1672],{"type":44,"value":803},{"type":38,"tag":542,"props":1674,"children":1675},{"style":806},[1676],{"type":44,"value":1677},"req",{"type":38,"tag":542,"props":1679,"children":1680},{"style":565},[1681],{"type":44,"value":676},{"type":38,"tag":542,"props":1683,"children":1684},{"style":806},[1685],{"type":44,"value":1686}," res",{"type":38,"tag":542,"props":1688,"children":1689},{"style":565},[1690],{"type":44,"value":615},{"type":38,"tag":542,"props":1692,"children":1693},{"style":559},[1694],{"type":44,"value":1695}," =>",{"type":38,"tag":542,"props":1697,"children":1698},{"style":565},[1699],{"type":44,"value":681},{"type":38,"tag":542,"props":1701,"children":1702},{"class":544,"line":969},[1703,1707,1711,1715,1719,1723,1727,1731,1735,1739,1743,1747,1751,1756],{"type":38,"tag":542,"props":1704,"children":1705},{"style":559},[1706],{"type":44,"value":835},{"type":38,"tag":542,"props":1708,"children":1709},{"style":571},[1710],{"type":44,"value":849},{"type":38,"tag":542,"props":1712,"children":1713},{"style":565},[1714],{"type":44,"value":584},{"type":38,"tag":542,"props":1716,"children":1717},{"style":565},[1718],{"type":44,"value":643},{"type":38,"tag":542,"props":1720,"children":1721},{"style":587},[1722],{"type":44,"value":648},{"type":38,"tag":542,"props":1724,"children":1725},{"style":688},[1726],{"type":44,"value":595},{"type":38,"tag":542,"props":1728,"children":1729},{"style":571},[1730],{"type":44,"value":1555},{"type":38,"tag":542,"props":1732,"children":1733},{"style":565},[1734],{"type":44,"value":109},{"type":38,"tag":542,"props":1736,"children":1737},{"style":571},[1738],{"type":44,"value":662},{"type":38,"tag":542,"props":1740,"children":1741},{"style":565},[1742],{"type":44,"value":109},{"type":38,"tag":542,"props":1744,"children":1745},{"style":571},[1746],{"type":44,"value":671},{"type":38,"tag":542,"props":1748,"children":1749},{"style":688},[1750],{"type":44,"value":615},{"type":38,"tag":542,"props":1752,"children":1753},{"style":565},[1754],{"type":44,"value":1755},";",{"type":38,"tag":542,"props":1757,"children":1758},{"style":549},[1759],{"type":44,"value":1760}," \u002F\u002F DON'T DO THIS\n",{"type":38,"tag":542,"props":1762,"children":1763},{"class":544,"line":1013},[1764],{"type":38,"tag":542,"props":1765,"children":1766},{"style":549},[1767],{"type":44,"value":1768},"  \u002F\u002F ...\n",{"type":38,"tag":542,"props":1770,"children":1772},{"class":544,"line":1771},14,[1773,1778,1782,1786,1791,1795],{"type":38,"tag":542,"props":1774,"children":1775},{"style":903},[1776],{"type":44,"value":1777},"  await",{"type":38,"tag":542,"props":1779,"children":1780},{"style":571},[1781],{"type":44,"value":849},{"type":38,"tag":542,"props":1783,"children":1784},{"style":565},[1785],{"type":44,"value":109},{"type":38,"tag":542,"props":1787,"children":1788},{"style":587},[1789],{"type":44,"value":1790},"close",{"type":38,"tag":542,"props":1792,"children":1793},{"style":688},[1794],{"type":44,"value":1490},{"type":38,"tag":542,"props":1796,"children":1797},{"style":565},[1798],{"type":44,"value":620},{"type":38,"tag":542,"props":1800,"children":1802},{"class":544,"line":1801},15,[1803,1807,1811],{"type":38,"tag":542,"props":1804,"children":1805},{"style":565},[1806],{"type":44,"value":579},{"type":38,"tag":542,"props":1808,"children":1809},{"style":571},[1810],{"type":44,"value":615},{"type":38,"tag":542,"props":1812,"children":1813},{"style":565},[1814],{"type":44,"value":620},{"type":38,"tag":53,"props":1816,"children":1818},{"id":1817},"troubleshooting-connection-issues",[1819],{"type":44,"value":1820},"Troubleshooting Connection Issues",{"type":38,"tag":216,"props":1822,"children":1824},{"id":1823},"pool-exhaustion",[1825],{"type":44,"value":1826},"Pool Exhaustion",{"type":38,"tag":47,"props":1828,"children":1829},{},[1830,1835,1837,1843],{"type":38,"tag":63,"props":1831,"children":1832},{},[1833],{"type":44,"value":1834},"Symptoms:",{"type":44,"value":1836}," ",{"type":38,"tag":102,"props":1838,"children":1840},{"className":1839},[],[1841],{"type":44,"value":1842},"MongoWaitQueueTimeoutError",{"type":44,"value":1844},", increased latency, operations\nwaiting.",{"type":38,"tag":47,"props":1846,"children":1847},{},[1848],{"type":38,"tag":63,"props":1849,"children":1850},{},[1851],{"type":44,"value":1852},"Solutions:",{"type":38,"tag":77,"props":1854,"children":1855},{},[1856,1871],{"type":38,"tag":81,"props":1857,"children":1858},{},[1859,1869],{"type":38,"tag":63,"props":1860,"children":1861},{},[1862,1864],{"type":44,"value":1863},"Increase ",{"type":38,"tag":102,"props":1865,"children":1867},{"className":1866},[],[1868],{"type":44,"value":435},{"type":44,"value":1870}," when: Wait queue has operations waiting + server\nshows low utilization",{"type":38,"tag":81,"props":1872,"children":1873},{},[1874,1879],{"type":38,"tag":63,"props":1875,"children":1876},{},[1877],{"type":44,"value":1878},"Don't increase",{"type":44,"value":1880}," when: Server is at capacity → optimize queries instead",{"type":38,"tag":216,"props":1882,"children":1884},{"id":1883},"connection-timeouts-econnrefused-sockettimeout",[1885],{"type":44,"value":1886},"Connection Timeouts (ECONNREFUSED, SocketTimeout)",{"type":38,"tag":47,"props":1888,"children":1889},{},[1890,1895,1897,1902,1904,1909],{"type":38,"tag":63,"props":1891,"children":1892},{},[1893],{"type":44,"value":1894},"Client Solutions:",{"type":44,"value":1896}," Increase ",{"type":38,"tag":102,"props":1898,"children":1900},{"className":1899},[],[1901],{"type":44,"value":500},{"type":44,"value":1903}," \u002F ",{"type":38,"tag":102,"props":1905,"children":1907},{"className":1906},[],[1908],{"type":44,"value":522},{"type":44,"value":1910}," if\nlegitimately needed.",{"type":38,"tag":47,"props":1912,"children":1913},{},[1914],{"type":38,"tag":63,"props":1915,"children":1916},{},[1917],{"type":44,"value":1918},"Azure-specific checks:",{"type":38,"tag":77,"props":1920,"children":1921},{},[1922,1927,1932],{"type":38,"tag":81,"props":1923,"children":1924},{},[1925],{"type":44,"value":1926},"Verify IP is allowlisted in Azure portal → Networking settings",{"type":38,"tag":81,"props":1928,"children":1929},{},[1930],{"type":44,"value":1931},"Check VNet\u002FPrivateLink configuration if using private endpoints",{"type":38,"tag":81,"props":1933,"children":1934},{},[1935,1937,1942],{"type":44,"value":1936},"Verify TLS settings (",{"type":38,"tag":102,"props":1938,"children":1940},{"className":1939},[],[1941],{"type":44,"value":277},{"type":44,"value":615},{"type":38,"tag":216,"props":1944,"children":1946},{"id":1945},"connection-churn",[1947],{"type":44,"value":1948},"Connection Churn",{"type":38,"tag":47,"props":1950,"children":1951},{},[1952,1956],{"type":38,"tag":63,"props":1953,"children":1954},{},[1955],{"type":44,"value":1834},{"type":44,"value":1957}," Rapidly increasing connection creation, high CPU from connection\nhandling.",{"type":38,"tag":47,"props":1959,"children":1960},{},[1961,1966,1968,1973],{"type":38,"tag":63,"props":1962,"children":1963},{},[1964],{"type":44,"value":1965},"Causes:",{"type":44,"value":1967}," Not using singleton pattern, not caching client in serverless,\n",{"type":38,"tag":102,"props":1969,"children":1971},{"className":1970},[],[1972],{"type":44,"value":107},{"type":44,"value":1974}," too low, restart loops.",{"type":38,"tag":216,"props":1976,"children":1978},{"id":1977},"high-latency",[1979],{"type":44,"value":1980},"High Latency",{"type":38,"tag":77,"props":1982,"children":1983},{},[1984,1996,2007],{"type":38,"tag":81,"props":1985,"children":1986},{},[1987,1989,1994],{"type":44,"value":1988},"Ensure ",{"type":38,"tag":102,"props":1990,"children":1992},{"className":1991},[],[1993],{"type":44,"value":457},{"type":44,"value":1995}," > 0 for traffic spikes",{"type":38,"tag":81,"props":1997,"children":1998},{},[1999,2001],{"type":44,"value":2000},"Network compression for high-latency connections:\n",{"type":38,"tag":102,"props":2002,"children":2004},{"className":2003},[],[2005],{"type":44,"value":2006},"compressors: ['snappy', 'zlib']",{"type":38,"tag":81,"props":2008,"children":2009},{},[2010],{"type":44,"value":2011},"Use nearest read preference for geo-distributed setups",{"type":38,"tag":53,"props":2013,"children":2015},{"id":2014},"retry-logic",[2016],{"type":44,"value":2017},"Retry Logic",{"type":38,"tag":47,"props":2019,"children":2020},{},[2021],{"type":44,"value":2022},"Azure DocumentDB supports retryable writes and reads. Enable them:",{"type":38,"tag":223,"props":2024,"children":2026},{"className":534,"code":2025,"language":536,"meta":231,"style":231},"const client = new MongoClient(uri, {\n  retryWrites: true,\n  retryReads: true,\n});\n",[2027],{"type":38,"tag":102,"props":2028,"children":2029},{"__ignoreMap":231},[2030,2066,2088,2108],{"type":38,"tag":542,"props":2031,"children":2032},{"class":544,"line":545},[2033,2037,2041,2045,2049,2053,2058,2062],{"type":38,"tag":542,"props":2034,"children":2035},{"style":559},[2036],{"type":44,"value":562},{"type":38,"tag":542,"props":2038,"children":2039},{"style":571},[2040],{"type":44,"value":633},{"type":38,"tag":542,"props":2042,"children":2043},{"style":565},[2044],{"type":44,"value":638},{"type":38,"tag":542,"props":2046,"children":2047},{"style":565},[2048],{"type":44,"value":643},{"type":38,"tag":542,"props":2050,"children":2051},{"style":587},[2052],{"type":44,"value":648},{"type":38,"tag":542,"props":2054,"children":2055},{"style":571},[2056],{"type":44,"value":2057},"(uri",{"type":38,"tag":542,"props":2059,"children":2060},{"style":565},[2061],{"type":44,"value":676},{"type":38,"tag":542,"props":2063,"children":2064},{"style":565},[2065],{"type":44,"value":681},{"type":38,"tag":542,"props":2067,"children":2068},{"class":544,"line":555},[2069,2074,2078,2084],{"type":38,"tag":542,"props":2070,"children":2071},{"style":688},[2072],{"type":44,"value":2073},"  retryWrites",{"type":38,"tag":542,"props":2075,"children":2076},{"style":565},[2077],{"type":44,"value":696},{"type":38,"tag":542,"props":2079,"children":2081},{"style":2080},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[2082],{"type":44,"value":2083}," true",{"type":38,"tag":542,"props":2085,"children":2086},{"style":565},[2087],{"type":44,"value":707},{"type":38,"tag":542,"props":2089,"children":2090},{"class":544,"line":623},[2091,2096,2100,2104],{"type":38,"tag":542,"props":2092,"children":2093},{"style":688},[2094],{"type":44,"value":2095},"  retryReads",{"type":38,"tag":542,"props":2097,"children":2098},{"style":565},[2099],{"type":44,"value":696},{"type":38,"tag":542,"props":2101,"children":2102},{"style":2080},[2103],{"type":44,"value":2083},{"type":38,"tag":542,"props":2105,"children":2106},{"style":565},[2107],{"type":44,"value":707},{"type":38,"tag":542,"props":2109,"children":2110},{"class":544,"line":684},[2111,2115,2119],{"type":38,"tag":542,"props":2112,"children":2113},{"style":565},[2114],{"type":44,"value":579},{"type":38,"tag":542,"props":2116,"children":2117},{"style":571},[2118],{"type":44,"value":615},{"type":38,"tag":542,"props":2120,"children":2121},{"style":565},[2122],{"type":44,"value":620},{"type":38,"tag":47,"props":2124,"children":2125},{},[2126],{"type":44,"value":2127},"For transient errors (network blips, failovers), the driver will automatically\nretry. For application-level retries on specific error codes, implement\nexponential backoff:",{"type":38,"tag":223,"props":2129,"children":2131},{"className":534,"code":2130,"language":536,"meta":231,"style":231},"async function withRetry(fn, maxRetries = 3) {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    try {\n      return await fn();\n    } catch (err) {\n      if (i === maxRetries - 1) throw err;\n      if (err.code === 16500 || err.code === 429) {\n        \u002F\u002F Rate limited — wait and retry\n        const waitMs = Math.min(1000 * Math.pow(2, i), 30000);\n        await new Promise(r => setTimeout(r, waitMs));\n      } else {\n        throw err; \u002F\u002F Non-retryable error\n      }\n    }\n  }\n}\n",[2132],{"type":38,"tag":102,"props":2133,"children":2134},{"__ignoreMap":231},[2135,2187,2254,2266,2291,2321,2375,2441,2449,2544,2605,2622,2643,2651,2659,2666],{"type":38,"tag":542,"props":2136,"children":2137},{"class":544,"line":545},[2138,2143,2147,2152,2156,2161,2165,2170,2174,2179,2183],{"type":38,"tag":542,"props":2139,"children":2140},{"style":559},[2141],{"type":44,"value":2142},"async",{"type":38,"tag":542,"props":2144,"children":2145},{"style":559},[2146],{"type":44,"value":798},{"type":38,"tag":542,"props":2148,"children":2149},{"style":587},[2150],{"type":44,"value":2151}," withRetry",{"type":38,"tag":542,"props":2153,"children":2154},{"style":565},[2155],{"type":44,"value":595},{"type":38,"tag":542,"props":2157,"children":2158},{"style":806},[2159],{"type":44,"value":2160},"fn",{"type":38,"tag":542,"props":2162,"children":2163},{"style":565},[2164],{"type":44,"value":676},{"type":38,"tag":542,"props":2166,"children":2167},{"style":806},[2168],{"type":44,"value":2169}," maxRetries",{"type":38,"tag":542,"props":2171,"children":2172},{"style":565},[2173],{"type":44,"value":584},{"type":38,"tag":542,"props":2175,"children":2176},{"style":699},[2177],{"type":44,"value":2178}," 3",{"type":38,"tag":542,"props":2180,"children":2181},{"style":565},[2182],{"type":44,"value":615},{"type":38,"tag":542,"props":2184,"children":2185},{"style":565},[2186],{"type":44,"value":681},{"type":38,"tag":542,"props":2188,"children":2189},{"class":544,"line":555},[2190,2195,2199,2203,2208,2212,2216,2220,2224,2229,2233,2237,2241,2246,2250],{"type":38,"tag":542,"props":2191,"children":2192},{"style":903},[2193],{"type":44,"value":2194},"  for",{"type":38,"tag":542,"props":2196,"children":2197},{"style":688},[2198],{"type":44,"value":803},{"type":38,"tag":542,"props":2200,"children":2201},{"style":559},[2202],{"type":44,"value":1464},{"type":38,"tag":542,"props":2204,"children":2205},{"style":571},[2206],{"type":44,"value":2207}," i",{"type":38,"tag":542,"props":2209,"children":2210},{"style":565},[2211],{"type":44,"value":584},{"type":38,"tag":542,"props":2213,"children":2214},{"style":699},[2215],{"type":44,"value":724},{"type":38,"tag":542,"props":2217,"children":2218},{"style":565},[2219],{"type":44,"value":1755},{"type":38,"tag":542,"props":2221,"children":2222},{"style":571},[2223],{"type":44,"value":2207},{"type":38,"tag":542,"props":2225,"children":2226},{"style":565},[2227],{"type":44,"value":2228}," \u003C",{"type":38,"tag":542,"props":2230,"children":2231},{"style":571},[2232],{"type":44,"value":2169},{"type":38,"tag":542,"props":2234,"children":2235},{"style":565},[2236],{"type":44,"value":1755},{"type":38,"tag":542,"props":2238,"children":2239},{"style":571},[2240],{"type":44,"value":2207},{"type":38,"tag":542,"props":2242,"children":2243},{"style":565},[2244],{"type":44,"value":2245},"++",{"type":38,"tag":542,"props":2247,"children":2248},{"style":688},[2249],{"type":44,"value":1521},{"type":38,"tag":542,"props":2251,"children":2252},{"style":565},[2253],{"type":44,"value":1526},{"type":38,"tag":542,"props":2255,"children":2256},{"class":544,"line":623},[2257,2262],{"type":38,"tag":542,"props":2258,"children":2259},{"style":903},[2260],{"type":44,"value":2261},"    try",{"type":38,"tag":542,"props":2263,"children":2264},{"style":565},[2265],{"type":44,"value":681},{"type":38,"tag":542,"props":2267,"children":2268},{"class":544,"line":684},[2269,2274,2278,2283,2287],{"type":38,"tag":542,"props":2270,"children":2271},{"style":903},[2272],{"type":44,"value":2273},"      return",{"type":38,"tag":542,"props":2275,"children":2276},{"style":903},[2277],{"type":44,"value":906},{"type":38,"tag":542,"props":2279,"children":2280},{"style":587},[2281],{"type":44,"value":2282}," fn",{"type":38,"tag":542,"props":2284,"children":2285},{"style":688},[2286],{"type":44,"value":1490},{"type":38,"tag":542,"props":2288,"children":2289},{"style":565},[2290],{"type":44,"value":620},{"type":38,"tag":542,"props":2292,"children":2293},{"class":544,"line":21},[2294,2299,2304,2308,2313,2317],{"type":38,"tag":542,"props":2295,"children":2296},{"style":565},[2297],{"type":44,"value":2298},"    }",{"type":38,"tag":542,"props":2300,"children":2301},{"style":903},[2302],{"type":44,"value":2303}," catch",{"type":38,"tag":542,"props":2305,"children":2306},{"style":688},[2307],{"type":44,"value":803},{"type":38,"tag":542,"props":2309,"children":2310},{"style":571},[2311],{"type":44,"value":2312},"err",{"type":38,"tag":542,"props":2314,"children":2315},{"style":688},[2316],{"type":44,"value":1521},{"type":38,"tag":542,"props":2318,"children":2319},{"style":565},[2320],{"type":44,"value":1526},{"type":38,"tag":542,"props":2322,"children":2323},{"class":544,"line":731},[2324,2329,2333,2338,2343,2347,2352,2357,2361,2366,2371],{"type":38,"tag":542,"props":2325,"children":2326},{"style":903},[2327],{"type":44,"value":2328},"      if",{"type":38,"tag":542,"props":2330,"children":2331},{"style":688},[2332],{"type":44,"value":803},{"type":38,"tag":542,"props":2334,"children":2335},{"style":571},[2336],{"type":44,"value":2337},"i",{"type":38,"tag":542,"props":2339,"children":2340},{"style":565},[2341],{"type":44,"value":2342}," ===",{"type":38,"tag":542,"props":2344,"children":2345},{"style":571},[2346],{"type":44,"value":2169},{"type":38,"tag":542,"props":2348,"children":2349},{"style":565},[2350],{"type":44,"value":2351}," -",{"type":38,"tag":542,"props":2353,"children":2354},{"style":699},[2355],{"type":44,"value":2356}," 1",{"type":38,"tag":542,"props":2358,"children":2359},{"style":688},[2360],{"type":44,"value":1521},{"type":38,"tag":542,"props":2362,"children":2363},{"style":903},[2364],{"type":44,"value":2365},"throw",{"type":38,"tag":542,"props":2367,"children":2368},{"style":571},[2369],{"type":44,"value":2370}," err",{"type":38,"tag":542,"props":2372,"children":2373},{"style":565},[2374],{"type":44,"value":620},{"type":38,"tag":542,"props":2376,"children":2377},{"class":544,"line":25},[2378,2382,2386,2390,2394,2398,2402,2407,2412,2416,2420,2424,2428,2433,2437],{"type":38,"tag":542,"props":2379,"children":2380},{"style":903},[2381],{"type":44,"value":2328},{"type":38,"tag":542,"props":2383,"children":2384},{"style":688},[2385],{"type":44,"value":803},{"type":38,"tag":542,"props":2387,"children":2388},{"style":571},[2389],{"type":44,"value":2312},{"type":38,"tag":542,"props":2391,"children":2392},{"style":565},[2393],{"type":44,"value":109},{"type":38,"tag":542,"props":2395,"children":2396},{"style":571},[2397],{"type":44,"value":102},{"type":38,"tag":542,"props":2399,"children":2400},{"style":565},[2401],{"type":44,"value":2342},{"type":38,"tag":542,"props":2403,"children":2404},{"style":699},[2405],{"type":44,"value":2406}," 16500",{"type":38,"tag":542,"props":2408,"children":2409},{"style":565},[2410],{"type":44,"value":2411}," ||",{"type":38,"tag":542,"props":2413,"children":2414},{"style":571},[2415],{"type":44,"value":2370},{"type":38,"tag":542,"props":2417,"children":2418},{"style":565},[2419],{"type":44,"value":109},{"type":38,"tag":542,"props":2421,"children":2422},{"style":571},[2423],{"type":44,"value":102},{"type":38,"tag":542,"props":2425,"children":2426},{"style":565},[2427],{"type":44,"value":2342},{"type":38,"tag":542,"props":2429,"children":2430},{"style":699},[2431],{"type":44,"value":2432}," 429",{"type":38,"tag":542,"props":2434,"children":2435},{"style":688},[2436],{"type":44,"value":1521},{"type":38,"tag":542,"props":2438,"children":2439},{"style":565},[2440],{"type":44,"value":1526},{"type":38,"tag":542,"props":2442,"children":2443},{"class":544,"line":768},[2444],{"type":38,"tag":542,"props":2445,"children":2446},{"style":549},[2447],{"type":44,"value":2448},"        \u002F\u002F Rate limited — wait and retry\n",{"type":38,"tag":542,"props":2450,"children":2451},{"class":544,"line":778},[2452,2457,2462,2466,2471,2475,2480,2484,2489,2494,2498,2502,2507,2511,2516,2520,2524,2528,2532,2536,2540],{"type":38,"tag":542,"props":2453,"children":2454},{"style":559},[2455],{"type":44,"value":2456},"        const",{"type":38,"tag":542,"props":2458,"children":2459},{"style":571},[2460],{"type":44,"value":2461}," waitMs",{"type":38,"tag":542,"props":2463,"children":2464},{"style":565},[2465],{"type":44,"value":584},{"type":38,"tag":542,"props":2467,"children":2468},{"style":571},[2469],{"type":44,"value":2470}," Math",{"type":38,"tag":542,"props":2472,"children":2473},{"style":565},[2474],{"type":44,"value":109},{"type":38,"tag":542,"props":2476,"children":2477},{"style":587},[2478],{"type":44,"value":2479},"min",{"type":38,"tag":542,"props":2481,"children":2482},{"style":688},[2483],{"type":44,"value":595},{"type":38,"tag":542,"props":2485,"children":2486},{"style":699},[2487],{"type":44,"value":2488},"1000",{"type":38,"tag":542,"props":2490,"children":2491},{"style":565},[2492],{"type":44,"value":2493}," *",{"type":38,"tag":542,"props":2495,"children":2496},{"style":571},[2497],{"type":44,"value":2470},{"type":38,"tag":542,"props":2499,"children":2500},{"style":565},[2501],{"type":44,"value":109},{"type":38,"tag":542,"props":2503,"children":2504},{"style":587},[2505],{"type":44,"value":2506},"pow",{"type":38,"tag":542,"props":2508,"children":2509},{"style":688},[2510],{"type":44,"value":595},{"type":38,"tag":542,"props":2512,"children":2513},{"style":699},[2514],{"type":44,"value":2515},"2",{"type":38,"tag":542,"props":2517,"children":2518},{"style":565},[2519],{"type":44,"value":676},{"type":38,"tag":542,"props":2521,"children":2522},{"style":571},[2523],{"type":44,"value":2207},{"type":38,"tag":542,"props":2525,"children":2526},{"style":688},[2527],{"type":44,"value":615},{"type":38,"tag":542,"props":2529,"children":2530},{"style":565},[2531],{"type":44,"value":676},{"type":38,"tag":542,"props":2533,"children":2534},{"style":699},[2535],{"type":44,"value":746},{"type":38,"tag":542,"props":2537,"children":2538},{"style":688},[2539],{"type":44,"value":615},{"type":38,"tag":542,"props":2541,"children":2542},{"style":565},[2543],{"type":44,"value":620},{"type":38,"tag":542,"props":2545,"children":2546},{"class":544,"line":829},[2547,2552,2556,2562,2566,2571,2575,2580,2584,2588,2592,2596,2601],{"type":38,"tag":542,"props":2548,"children":2549},{"style":903},[2550],{"type":44,"value":2551},"        await",{"type":38,"tag":542,"props":2553,"children":2554},{"style":565},[2555],{"type":44,"value":643},{"type":38,"tag":542,"props":2557,"children":2559},{"style":2558},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[2560],{"type":44,"value":2561}," Promise",{"type":38,"tag":542,"props":2563,"children":2564},{"style":688},[2565],{"type":44,"value":595},{"type":38,"tag":542,"props":2567,"children":2568},{"style":806},[2569],{"type":44,"value":2570},"r",{"type":38,"tag":542,"props":2572,"children":2573},{"style":559},[2574],{"type":44,"value":1695},{"type":38,"tag":542,"props":2576,"children":2577},{"style":587},[2578],{"type":44,"value":2579}," setTimeout",{"type":38,"tag":542,"props":2581,"children":2582},{"style":688},[2583],{"type":44,"value":595},{"type":38,"tag":542,"props":2585,"children":2586},{"style":571},[2587],{"type":44,"value":2570},{"type":38,"tag":542,"props":2589,"children":2590},{"style":565},[2591],{"type":44,"value":676},{"type":38,"tag":542,"props":2593,"children":2594},{"style":571},[2595],{"type":44,"value":2461},{"type":38,"tag":542,"props":2597,"children":2598},{"style":688},[2599],{"type":44,"value":2600},"))",{"type":38,"tag":542,"props":2602,"children":2603},{"style":565},[2604],{"type":44,"value":620},{"type":38,"tag":542,"props":2606,"children":2607},{"class":544,"line":886},[2608,2613,2618],{"type":38,"tag":542,"props":2609,"children":2610},{"style":565},[2611],{"type":44,"value":2612},"      }",{"type":38,"tag":542,"props":2614,"children":2615},{"style":903},[2616],{"type":44,"value":2617}," else",{"type":38,"tag":542,"props":2619,"children":2620},{"style":565},[2621],{"type":44,"value":681},{"type":38,"tag":542,"props":2623,"children":2624},{"class":544,"line":969},[2625,2630,2634,2638],{"type":38,"tag":542,"props":2626,"children":2627},{"style":903},[2628],{"type":44,"value":2629},"        throw",{"type":38,"tag":542,"props":2631,"children":2632},{"style":571},[2633],{"type":44,"value":2370},{"type":38,"tag":542,"props":2635,"children":2636},{"style":565},[2637],{"type":44,"value":1755},{"type":38,"tag":542,"props":2639,"children":2640},{"style":549},[2641],{"type":44,"value":2642}," \u002F\u002F Non-retryable error\n",{"type":38,"tag":542,"props":2644,"children":2645},{"class":544,"line":1013},[2646],{"type":38,"tag":542,"props":2647,"children":2648},{"style":565},[2649],{"type":44,"value":2650},"      }\n",{"type":38,"tag":542,"props":2652,"children":2653},{"class":544,"line":1771},[2654],{"type":38,"tag":542,"props":2655,"children":2656},{"style":565},[2657],{"type":44,"value":2658},"    }\n",{"type":38,"tag":542,"props":2660,"children":2661},{"class":544,"line":1801},[2662],{"type":38,"tag":542,"props":2663,"children":2664},{"style":565},[2665],{"type":44,"value":1587},{"type":38,"tag":542,"props":2667,"children":2669},{"class":544,"line":2668},16,[2670],{"type":38,"tag":542,"props":2671,"children":2672},{"style":565},[2673],{"type":44,"value":1611},{"type":38,"tag":53,"props":2675,"children":2677},{"id":2676},"environmental-context",[2678],{"type":44,"value":2679},"Environmental Context",{"type":38,"tag":47,"props":2681,"children":2682},{},[2683,2688],{"type":38,"tag":63,"props":2684,"children":2685},{},[2686],{"type":44,"value":2687},"ALWAYS",{"type":44,"value":2689}," verify you have sufficient context about the user's application\nbefore suggesting configuration changes.",{"type":38,"tag":216,"props":2691,"children":2693},{"id":2692},"parameters-that-inform-configuration",[2694],{"type":44,"value":2695},"Parameters That Inform Configuration",{"type":38,"tag":77,"props":2697,"children":2698},{},[2699,2709,2719,2729,2739,2749],{"type":38,"tag":81,"props":2700,"children":2701},{},[2702,2707],{"type":38,"tag":63,"props":2703,"children":2704},{},[2705],{"type":44,"value":2706},"Server memory limits",{"type":44,"value":2708},": Each connection takes ~1MB on the server",{"type":38,"tag":81,"props":2710,"children":2711},{},[2712,2717],{"type":38,"tag":63,"props":2713,"children":2714},{},[2715],{"type":44,"value":2716},"Number of clients",{"type":44,"value":2718},": Pools are per client and per server",{"type":38,"tag":81,"props":2720,"children":2721},{},[2722,2727],{"type":38,"tag":63,"props":2723,"children":2724},{},[2725],{"type":44,"value":2726},"OLAP vs OLTP",{"type":44,"value":2728},": Timeout values must support expected operation duration",{"type":38,"tag":81,"props":2730,"children":2731},{},[2732,2737],{"type":38,"tag":63,"props":2733,"children":2734},{},[2735],{"type":44,"value":2736},"Serverless vs Traditional",{"type":44,"value":2738},": Client initialization strategy differs",{"type":38,"tag":81,"props":2740,"children":2741},{},[2742,2747],{"type":38,"tag":63,"props":2743,"children":2744},{},[2745],{"type":44,"value":2746},"Concurrency and traffic patterns",{"type":44,"value":2748},": Inform pool sizing",{"type":38,"tag":81,"props":2750,"children":2751},{},[2752,2757],{"type":38,"tag":63,"props":2753,"children":2754},{},[2755],{"type":44,"value":2756},"Operating system",{"type":44,"value":2758},": File descriptor limits can impact max connections",{"type":38,"tag":47,"props":2760,"children":2761},{},[2762],{"type":38,"tag":63,"props":2763,"children":2764},{},[2765],{"type":44,"value":2766},"Guidelines:",{"type":38,"tag":77,"props":2768,"children":2769},{},[2770,2775],{"type":38,"tag":81,"props":2771,"children":2772},{},[2773],{"type":44,"value":2774},"Ask only questions relevant to the scenario",{"type":38,"tag":81,"props":2776,"children":2777},{},[2778],{"type":44,"value":2779},"If an answer is not provided, make a reasonable assumption and disclose it",{"type":38,"tag":53,"props":2781,"children":2783},{"id":2782},"when-creating-code",[2784],{"type":44,"value":2785},"When Creating Code",{"type":38,"tag":47,"props":2787,"children":2788},{},[2789],{"type":44,"value":2790},"For every connection parameter you provide, ensure you have enough context about\nthe user's application to justify the values. If not, ask targeted questions\nfirst. If you get no answer, make a reasonable assumption, disclose it, and\ncomment the relevant parameters in the code.",{"type":38,"tag":2792,"props":2793,"children":2794},"style",{},[2795],{"type":44,"value":2796},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":2798,"total":2893},[2799,2820,2826,2840,2853,2865,2878],{"slug":2800,"name":2800,"fn":2801,"description":2802,"org":2803,"tags":2804,"stars":21,"repoUrl":22,"updatedAt":2819},"documentdb-azure-deployment","deploy Azure DocumentDB clusters","Deploy an Azure DocumentDB cluster (`Microsoft.DocumentDB\u002FmongoClusters`) end-to-end — Bicep (primary), Azure CLI one-shot, Terraform, or portal. Covers resource-group creation, cluster parameters (tier, storage, server version, sharding, HA), firewall rule configuration, retrieving the connection string, and teardown. Use when the user asks to provision, create, deploy, or spin up an Azure DocumentDB cluster, or wants infrastructure-as-code for one.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2805,2806,2809,2812,2813,2816],{"name":11,"slug":8,"type":16},{"name":2807,"slug":2808,"type":16},"Bicep","bicep",{"name":2810,"slug":2811,"type":16},"CLI","cli",{"name":19,"slug":20,"type":16},{"name":2814,"slug":2815,"type":16},"Deployment","deployment",{"name":2817,"slug":2818,"type":16},"Terraform","terraform","2026-07-12T08:18:56.861159",{"slug":4,"name":4,"fn":5,"description":6,"org":2821,"tags":2822,"stars":21,"repoUrl":22,"updatedAt":23},{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2823,2824,2825],{"name":11,"slug":8,"type":16},{"name":19,"slug":20,"type":16},{"name":14,"slug":15,"type":16},{"slug":2827,"name":2827,"fn":2828,"description":2829,"org":2830,"tags":2831,"stars":21,"repoUrl":22,"updatedAt":2839},"documentdb-data-modeling","design Azure DocumentDB data models","Data modeling patterns for Azure DocumentDB — embed vs reference, 16 MB document limit, denormalization for read-heavy workloads, schema versioning. Use when designing new schemas, reviewing existing data models, migrating from SQL, deciding between embedding and referencing, modeling one-to-one \u002F one-to-many \u002F many-to-many relationships, or troubleshooting document-size and query-performance problems that stem from the data model.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2832,2833,2836,2837],{"name":11,"slug":8,"type":16},{"name":2834,"slug":2835,"type":16},"Data Modeling","data-modeling",{"name":19,"slug":20,"type":16},{"name":2838,"slug":606,"type":16},"MongoDB","2026-08-01T05:42:33.42955",{"slug":2841,"name":2841,"fn":2842,"description":2843,"org":2844,"tags":2845,"stars":21,"repoUrl":22,"updatedAt":2852},"documentdb-driver","implement Azure DocumentDB driver best practices","MongoDB driver and SDK best practices for Azure DocumentDB — singleton `MongoClient`, connection reuse, connection-pool fundamentals. Use when writing code that instantiates a MongoDB client, reviewing driver initialization, or diagnosing connection-related bugs. For full connection-pool tuning (serverless vs OLTP vs OLAP, timeouts, retries), see the `documentdb-connection` skill.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2846,2847,2848,2849],{"name":11,"slug":8,"type":16},{"name":19,"slug":20,"type":16},{"name":2838,"slug":606,"type":16},{"name":2850,"slug":2851,"type":16},"SDK","sdk","2026-07-12T08:18:42.136316",{"slug":2854,"name":2854,"fn":2855,"description":2856,"org":2857,"tags":2858,"stars":21,"repoUrl":22,"updatedAt":2864},"documentdb-full-text-search","implement full-text search in Azure DocumentDB","Full-text search best practices for Azure DocumentDB using the `createSearchIndexes` command and `$search` aggregation stage — BM25 keyword scoring, fuzzy search (`maxEdits`), phrase search with `slop`, custom analyzers (keyword + lowerCase + asciiFolding + edgeGram) for prefix \u002F ID matching, `pathHierarchy` tokenizer for hierarchical IDs, multi-field search indexes, and hybrid (BM25 + vector) retrieval via Reciprocal Rank Fusion. Use when building search experiences, adding typo tolerance, matching phrases or prefixes on IDs \u002F SKUs \u002F part numbers, or combining lexical and semantic retrieval on the same collection.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2859,2860,2861],{"name":11,"slug":8,"type":16},{"name":19,"slug":20,"type":16},{"name":2862,"slug":2863,"type":16},"Search","search","2026-07-15T06:02:41.270913",{"slug":2866,"name":2866,"fn":2867,"description":2868,"org":2869,"tags":2870,"stars":21,"repoUrl":22,"updatedAt":2877},"documentdb-high-availability","configure high availability for DocumentDB","High availability, business-continuity, and disaster-recovery best practices for Azure DocumentDB — enabling in-region HA with availability zones (99.99% SLA), adding active-passive cross-region replica clusters (99.995% SLA), and understanding automatic backup retention. Use when designing production topology, planning failover, provisioning DR, picking regions, or reviewing cluster architecture.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2871,2872,2873,2876],{"name":11,"slug":8,"type":16},{"name":19,"slug":20,"type":16},{"name":2874,"slug":2875,"type":16},"Operations","operations",{"name":14,"slug":15,"type":16},"2026-07-12T08:18:53.654505",{"slug":2879,"name":2879,"fn":2880,"description":2881,"org":2882,"tags":2883,"stars":21,"repoUrl":22,"updatedAt":2892},"documentdb-indexing","select and shape Azure DocumentDB indexes","Index-type selection and shape guidance for Azure DocumentDB — when to use single-field, compound (ESR), multikey, wildcard, hashed, 2dsphere, TTL, and vector indexes; query-pattern → index-shape cookbook; per-collection index budget; DocumentDB-specific preference for `textSearch` over community `$text`. Use when designing or reviewing indexes, choosing an index type for a query pattern, or deciding whether an additional index is worth the write cost.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2884,2885,2888,2889],{"name":11,"slug":8,"type":16},{"name":2886,"slug":2887,"type":16},"Cosmos DB","cosmos-db",{"name":19,"slug":20,"type":16},{"name":2890,"slug":2891,"type":16},"NoSQL","nosql","2026-07-12T08:18:44.753904",17,{"items":2895,"total":3068},[2896,2915,2932,2951,2964,2979,2992,3007,3018,3030,3043,3056],{"slug":2897,"name":2897,"fn":2898,"description":2899,"org":2900,"tags":2901,"stars":2912,"repoUrl":2913,"updatedAt":2914},"azure-arg-external-evaluation-policy-author","author and test Azure Resource Graph policies","Use when the user wants to author, design, or test an Azure Policy that queries Azure Resource Graph (ARG) at request-time — i.e. a policy whose deny\u002Faudit decision depends on data from elsewhere in the subscription (sibling\u002Fparent resource state, RG-wide invariants, multi-hop relationships, etc.). Formally called Azure Policy External Evaluation; sometimes referred to colloquially as \"Invoke\". Drives an iterative KQL co-design loop against the user's real subscription via `az graph query`, then emits a policy definition, assignment, `.http` test flow, and an `EXPLANATION.md` companion. Read-only; never provisions anything.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2902,2903,2906,2909],{"name":11,"slug":8,"type":16},{"name":2904,"slug":2905,"type":16},"Compliance","compliance",{"name":2907,"slug":2908,"type":16},"Governance","governance",{"name":2910,"slug":2911,"type":16},"Policy","policy",1686,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-policy","2026-07-12T08:17:48.378432",{"slug":2916,"name":2916,"fn":2917,"description":2918,"org":2919,"tags":2920,"stars":2929,"repoUrl":2930,"updatedAt":2931},"azure-blueprints-migration","migrate Azure Blueprints to Template Specs","Use when a user needs to migrate off Azure Blueprints (definitions and\u002For assignments) to Template Specs and Deployment Stacks before the January 31, 2027 retirement. Covers inventory, export, conversion to Bicep, policy decoupling, Template Spec publishing, Deployment Stack deployment with deny-settings, validation, and cutover.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2921,2922,2923,2926],{"name":11,"slug":8,"type":16},{"name":2814,"slug":2815,"type":16},{"name":2924,"slug":2925,"type":16},"Infrastructure as Code","infrastructure-as-code",{"name":2927,"slug":2928,"type":16},"Migration","migration",260,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-blueprints","2026-07-12T08:17:49.646405",{"slug":2933,"name":2933,"fn":2934,"description":2935,"org":2936,"tags":2937,"stars":2948,"repoUrl":2949,"updatedAt":2950},"apiview-feedback-resolution","resolve APIView feedback on Azure SDKs","Analyze and resolve APIView review feedback on Azure SDK PRs. **UTILITY SKILL**. USE FOR: APIView comments, API review feedback, SDK API surface changes. DO NOT USE FOR: general code review, non-APIView feedback. INVOKES: azure-sdk-mcp:azsdk_apiview_get_comments, azure-sdk-mcp:azsdk_typespec_customized_code_update.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2938,2941,2942,2945],{"name":2939,"slug":2940,"type":16},"API Development","api-development",{"name":11,"slug":8,"type":16},{"name":2943,"slug":2944,"type":16},"Code Review","code-review",{"name":2946,"slug":2947,"type":16},"Documentation","documentation",133,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-tools","2026-07-12T08:17:43.350876",{"slug":2952,"name":2952,"fn":2953,"description":2954,"org":2955,"tags":2956,"stars":2948,"repoUrl":2949,"updatedAt":2963},"azsdk-common-live-and-recorded-tests","deploy resources and run Azure SDK tests","Deploy test resources and run Azure SDK tests in live, record, or playback mode. WHEN: \"run live tests\", \"run recorded tests\", \"deploy test resources\", \"record tests\", \"run tests in record mode\", \"clean up test resources\", \"run tests against live resources\". DO NOT USE FOR: writing new tests, authoring Bicep templates, playback-only test runs without resource deployment. INVOKES: azure-sdk-mcp:azsdk_package_run_tests.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2957,2958,2959,2960],{"name":11,"slug":8,"type":16},{"name":2814,"slug":2815,"type":16},{"name":2850,"slug":2851,"type":16},{"name":2961,"slug":2962,"type":16},"Testing","testing","2026-07-12T08:17:44.718943",{"slug":2965,"name":2965,"fn":2966,"description":2967,"org":2968,"tags":2969,"stars":2948,"repoUrl":2949,"updatedAt":2978},"azsdk-common-prepare-release-plan","manage Azure SDK release plan work items","Create, get, update, abandon, and link SDK PRs to release plan work items for Azure SDK releases. **UTILITY SKILL**. USE FOR: \"create release plan\", \"get release plan\", \"update release plan\", \"update API spec in release plan\", \"update SDK details in release plan\", \"abandon release plan\", \"link SDK PR to plan\", \"namespace approval\", \"check release plan status\". DO NOT USE FOR: SDK code generation, pipeline troubleshooting, API review feedback. INVOKES: azure-sdk-mcp:azsdk_create_release_plan, azure-sdk-mcp:azsdk_get_release_plan, azure-sdk-mcp:azsdk_get_release_plan_for_spec_pr, azure-sdk-mcp:azsdk_update_release_plan, azure-sdk-mcp:azsdk_update_api_spec_pull_request_in_release_plan, azure-sdk-mcp:azsdk_update_sdk_details_in_release_plan, azure-sdk-mcp:azsdk_abandon_release_plan, azure-sdk-mcp:azsdk_link_sdk_pull_request_to_release_plan, azure-sdk-mcp:azsdk_link_namespace_approval_issue.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2970,2971,2974,2977],{"name":11,"slug":8,"type":16},{"name":2972,"slug":2973,"type":16},"GitHub","github",{"name":2975,"slug":2976,"type":16},"Project Management","project-management",{"name":2850,"slug":2851,"type":16},"2026-07-12T08:17:38.345387",{"slug":2980,"name":2980,"fn":2981,"description":2982,"org":2983,"tags":2984,"stars":2948,"repoUrl":2949,"updatedAt":2991},"azsdk-common-sdk-release","release Azure SDK packages","Check release readiness and trigger the release pipeline for Azure SDK packages. **UTILITY SKILL**. USE FOR: \"release SDK\", \"trigger release\", \"check release readiness\", \"release pipeline\", \"publish package\", \"ship SDK\". DO NOT USE FOR: SDK development, code generation, pipeline debugging, release plan creation. INVOKES: azure-sdk-mcp:azsdk_release_sdk.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2985,2986,2989,2990],{"name":11,"slug":8,"type":16},{"name":2987,"slug":2988,"type":16},"CI\u002FCD","ci-cd",{"name":2814,"slug":2815,"type":16},{"name":2850,"slug":2851,"type":16},"2026-07-12T08:17:34.27607",{"slug":2993,"name":2993,"fn":2994,"description":2995,"org":2996,"tags":2997,"stars":2948,"repoUrl":2949,"updatedAt":3006},"azure-typespec-author","author and modify Azure TypeSpec API specifications","Authors and modifies Azure TypeSpec (.tsp) API specifications. USE FOR: any TypeSpec\u002Ftsp change — api versions (add, bump, preview, stable, promote), resources, operations, models, properties, decorators, visibility, constraints, breaking changes, LRO, suppressions, operationId, spread model. Covers ARM resource-manager and data-plane services. DO NOT USE FOR: SDK generation, releasing SDK packages, or single MCP tool calls. INVOKES: azure-sdk-mcp:azsdk_typespec_generate_authoring_plan, azure-sdk-mcp:azsdk_run_typespec_validation.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[2998,2999,3000,3003],{"name":2939,"slug":2940,"type":16},{"name":11,"slug":8,"type":16},{"name":3001,"slug":3002,"type":16},"OpenAPI","openapi",{"name":3004,"slug":3005,"type":16},"Technical Writing","technical-writing","2026-07-12T08:17:39.603232",{"slug":3008,"name":3008,"fn":3009,"description":3010,"org":3011,"tags":3012,"stars":2948,"repoUrl":2949,"updatedAt":3017},"generate-sdk-locally","generate and test Azure SDKs locally","Generate, build, and test Azure SDKs locally from TypeSpec with automatic customization. WHEN: \"generate SDK locally\", \"build SDK\", \"run SDK tests\", \"run CI checks\", \"validate package\", \"run checks\", \"update changelog\", \"fix SDK build errors\", \"fix breaking changes\", \"resolve SDK generation errors\", \"customize TypeSpec\", \"rename SDK client\", \"rename SDK model\", \"hide operation from SDK\", \"fix analyzer errors\", \"resolve customization drift\", \"create subclient\", \"update metadata\", \"update version\". DO NOT USE FOR: publishing to package registries, CI pipeline configuration, API design review. INVOKES: azsdk_verify_setup, azsdk_package_generate_code, azsdk_package_build_code, azsdk_package_run_check, azsdk_package_run_tests, azsdk_customized_code_update, azsdk_package_update_changelog_content, azsdk_package_update_metadata, azsdk_package_update_version.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3013,3014,3015,3016],{"name":11,"slug":8,"type":16},{"name":2987,"slug":2988,"type":16},{"name":2850,"slug":2851,"type":16},{"name":2961,"slug":2962,"type":16},"2026-07-12T08:17:37.08523",{"slug":3019,"name":3019,"fn":3020,"description":3021,"org":3022,"tags":3023,"stars":2948,"repoUrl":2949,"updatedAt":3029},"markdown-token-optimizer","optimize markdown files for token efficiency","Analyze markdown files for token efficiency and reduce context-window bloat. **UTILITY SKILL**. DO NOT USE FOR: code optimization, general file editing, non-markdown files. TRIGGERS: optimize markdown, reduce tokens, token count, token bloat, too many tokens, make concise, shrink file, file too large, optimize for AI, token efficiency, verbose markdown, reduce file size. INVOKES: waza CLI.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3024,3027,3028],{"name":3025,"slug":3026,"type":16},"LLM","llm",{"name":14,"slug":15,"type":16},{"name":3004,"slug":3005,"type":16},"2026-07-12T08:17:42.080413",{"slug":3031,"name":3031,"fn":3032,"description":3033,"org":3034,"tags":3035,"stars":2948,"repoUrl":2949,"updatedAt":3042},"pipeline-troubleshooting","troubleshoot Azure SDK CI pipelines","Diagnose and resolve failures in Azure SDK CI and generation pipelines. **UTILITY SKILL**. USE FOR: \"pipeline failed\", \"build failure\", \"CI check failing\", \"SDK generation error\", \"reproduce pipeline locally\", \"debug SDK pipeline\". DO NOT USE FOR: local build issues without pipeline context, API design review, SDK publishing. INVOKES: azure-sdk-mcp:azsdk_analyze_pipeline, azure-sdk-mcp:azsdk_package_build_code, azure-sdk-mcp:azsdk_package_run_check.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3036,3037,3038,3041],{"name":11,"slug":8,"type":16},{"name":2987,"slug":2988,"type":16},{"name":3039,"slug":3040,"type":16},"Debugging","debugging",{"name":2850,"slug":2851,"type":16},"2026-07-12T08:17:40.821512",{"slug":3044,"name":3044,"fn":3045,"description":3046,"org":3047,"tags":3048,"stars":2948,"repoUrl":2949,"updatedAt":3055},"sensei","improve skill frontmatter compliance","**WORKFLOW SKILL** — Iteratively improve skill frontmatter compliance using the Ralph loop pattern. WHEN: \"run sensei\", \"sensei help\", \"improve skill\", \"fix frontmatter\", \"skill compliance\", \"frontmatter audit\", \"score skill\", \"check skill tokens\". INVOKES: token counting tools, test runners, git commands. FOR SINGLE OPERATIONS: use token CLI directly for counts\u002Fchecks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3049,3050,3051,3054],{"name":11,"slug":8,"type":16},{"name":2904,"slug":2905,"type":16},{"name":3052,"slug":3053,"type":16},"Process Optimization","process-optimization",{"name":3004,"slug":3005,"type":16},"2026-07-12T08:17:32.970921",{"slug":3057,"name":3057,"fn":3058,"description":3059,"org":3060,"tags":3061,"stars":2948,"repoUrl":2949,"updatedAt":3067},"skill-authoring","author agent skills for agentskills.io","Write Agent Skills that comply with the agentskills.io specification. WHEN: \"create a skill\", \"new skill\", \"write a skill\", \"skill template\", \"skill structure\", \"review skill\", \"skill PR\", \"skill compliance\", \"SKILL.md format\", \"skill frontmatter\", \"skill best practices\". DO NOT USE FOR: improving existing skills (use sensei), general documentation. INVOKES: waza CLI.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":11},[3062,3063,3066],{"name":2946,"slug":2947,"type":16},{"name":3064,"slug":3065,"type":16},"Plugin Development","plugin-development",{"name":3004,"slug":3005,"type":16},"2026-07-12T08:17:35.873862",109]