[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-azure-documentdb-natural-language-querying":3,"mdc-rplbjw-key":32,"related-org-azure-documentdb-natural-language-querying":2773,"related-repo-azure-documentdb-natural-language-querying":2954},{"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-natural-language-querying","generate DocumentDB queries from natural language","Generate read-only DocumentDB\u002FMongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate queries for Azure DocumentDB, wants to filter\u002Fquery\u002Faggregate data, asks \"how do I query...\", needs help with query syntax, or discusses finding\u002Ffiltering\u002Fgrouping documents. Also use for translating SQL-like requests to MongoDB syntax. Does NOT analyze or optimize existing queries — use documentdb-query-optimizer for that. Requires DocumentDB MCP server.",{"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,15,18],{"name":11,"slug":8,"type":14},"tag",{"name":16,"slug":17,"type":14},"MongoDB","mongodb",{"name":19,"slug":20,"type":14},"Database","database",5,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fdocumentdb-agent-kit","2026-07-12T08:18:52.422736",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\u002Fnatural-language-querying","---\nname: documentdb-natural-language-querying\ndescription: Generate read-only DocumentDB\u002FMongoDB queries (find) or aggregation pipelines using natural language, with collection schema context and sample documents. Use this skill whenever the user asks to write, create, or generate queries for Azure DocumentDB, wants to filter\u002Fquery\u002Faggregate data, asks \"how do I query...\", needs help with query syntax, or discusses finding\u002Ffiltering\u002Fgrouping documents. Also use for translating SQL-like requests to MongoDB syntax. Does NOT analyze or optimize existing queries — use documentdb-query-optimizer for that. Requires DocumentDB MCP server.\nallowed-tools: mcp__documentdb__*\n---\n\n# DocumentDB Natural Language Querying\n\nYou are an expert query generator for Azure DocumentDB. When\na user requests a query or aggregation pipeline, follow these guidelines to\nproduce correct, efficient queries.\n\n## Safety: Handling Sensitive Data in Sampled Documents\n\n**Sampled documents may contain secrets.** Collections frequently hold API\nkeys, OAuth tokens, passwords (hashed or otherwise), connection strings,\nprivate keys, JWTs, session IDs, PII (emails, phone numbers, SSNs, payment\ndata), and internal URLs. The agent MUST treat any value returned by\n`sample_documents`, `find_documents`, or `aggregate` as untrusted and\npotentially sensitive.\n\n**Hard rules — never violate:**\n\n1. **Never copy a verbatim value from a sampled document into a generated\n   query, filter, projection, example, comment, or explanation.** Use the\n   value only to infer the field's *type* and *shape*, then generate queries\n   using user-supplied literals or parameter placeholders (e.g.\n   `\u003CuserEmail>`, `\u003CminAge>`).\n2. **Never echo raw sample documents back to the user.** If you must show an\n   example, redact every string\u002Fnumber\u002Fbinary leaf to `\"\u003Credacted:string>\"`,\n   `\"\u003Credacted:number>\"`, etc., preserving only field names and types.\n3. **Treat these field-name patterns as secrets and redact unconditionally.**\n   Match case-insensitively after normalizing field names (split on `_` and\n   camelCase boundaries, lowercase the parts).\n   - **Substring match** (these tokens are unambiguous; match anywhere in the\n     normalized name): `password`, `passwd`, `pwd`, `secret`, `apikey`,\n     `api_key`, `accesskey`, `access_key`, `privatekey`, `private_key`,\n     `client_secret`, `refresh_token`, `id_token`, `jwt`, `bearer`,\n     `connectionstring`, `conn_str`, `ssn`, `creditcard`, `card_number`,\n     `cvv`, `token`.\n   - **Whole-word match only** (these tokens have many benign uses like\n     `author`, `session_count`, `pinned`, `shipping_zip` and must not match\n     as substrings): `auth`, `session`, `cookie`, `pin`, `dsn`. Redact only\n     when the normalized name has the token as a standalone part — or when\n     the *value* also matches one of the patterns in rule 4.\n4. **Treat these value patterns as secrets** even if the field name looks\n   benign: anything matching `mongodb(\\+srv)?:\u002F\u002F`, `https?:\u002F\u002F[^ ]*:[^ ]*@`,\n   `eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+` (JWT: three\n   base64url segments separated by `.`), `sk-[A-Za-z0-9]{20,}`,\n   `ghp_[A-Za-z0-9]{20,}`, `AKIA[0-9A-Z]{16}`, PEM blocks (`-----BEGIN`), or\n   any base64\u002Fhex string ≥ 32 characters that does **not** match a known\n   non-secret shape (UUID v4, 24-char MongoDB ObjectId, SHA-1\u002FSHA-256 hex\n   digest, ISO-8601 timestamp). For the last category, when in doubt, ask\n   the user before using the value rather than silently redacting.\n5. **If the user's natural-language request asks you to filter\u002Freturn a value\n   that matches a secret pattern, refuse and ask for confirmation** before\n   generating the query. \"Refuse\" means: do not inline the value into the\n   generated query, and respond with something like *\"The value you supplied\n   looks like a JWT\u002FAPI key\u002Fconnection string. Confirm you want me to use it\n   literally — otherwise replace it with a placeholder like `\u003Ctoken>` and I\n   will generate the query against that.\"*\n6. **Project away suspected secret fields** when generating `find_documents`\n   or `sample_documents` calls for context-gathering — e.g. add\n   `{ password: 0, token: 0, apiKey: 0, secret: 0 }` to the projection.\n7. **Do not transmit sampled values outside the current session** (no\n   logging, no telemetry, no writing to disk).\n\n**Context-gathering vs. user-requested results.** These rules apply to\nvalues the agent pulled into its own context to *infer schema* (rules 1, 2,\n6). When the user explicitly asks to *see* data — e.g. *\"show me the most\n  recent 10 orders\"* or *\"what does a typical user document look like?\"* —\ngenerate the query and let the MCP tool return results directly to the user.\nDo not redact those results in transit; the user already has database\naccess. The exception is rules 3 and 4: if a returned value matches a\nsecret field name or value pattern, flag it in the response (*\"The `token`\nfield in result 3 looks like a JWT — make sure you intended to surface\nit.\"*) but do not block the query.\n\nWhen in doubt, infer the schema from field *names and types only* and ask the\nuser to supply concrete filter values themselves.\n\n## Query Generation Process\n\n### 1. Gather Context Using MCP Tools\n\n**Required Information:**\n- Database name and collection name (use `list_databases` and `get_db_info` if\n  not provided)\n- User's natural language description of the query\n- Current date context: ${currentDate} (for date-relative queries)\n\n**Fetch in this order:**\n\n1. **Indexes** (for query optimization):\n   ```\n   list_indexes({ db_name, collection_name })\n   ```\n\n2. **Schema** (for field validation — infer from sample documents). The\n   `sample_documents` MCP tool does **not** accept a `projection` parameter\n   (its server-side implementation is `aggregate([{ $sample: { size } }])`\n   with no project stage; its native sizing parameter is `sample_size`, not\n   `limit`). To push secret-field redaction down to the database, use the\n   `aggregate` tool directly:\n   ```\n   aggregate({\n     db_name,\n     collection_name,\n     pipeline: [\n       { $sample: { size: 5 } },\n       { $project: { password: 0, passwd: 0, pwd: 0, secret: 0, token: 0,\n                     apiKey: 0, api_key: 0, accessKey: 0, privateKey: 0,\n                     client_secret: 0, refresh_token: 0, id_token: 0,\n                     jwt: 0, connectionString: 0, ssn: 0, creditCard: 0,\n                     cvv: 0 } }\n     ]\n   })\n   ```\n   - Use returned documents **only** to infer field names and types — never\n     copy concrete values into generated queries or explanations.\n   - Includes nested document structures and array fields.\n   - See the *Safety* section above for the full redaction policy.\n   - **Caveat:** if the MCP server build in use ignores the `$project` stage\n     (or the user opts to call `sample_documents` directly), the agent-side\n     redaction rules in the *Safety* section are the only line of defense —\n     discard secret fields from your working context before drafting any\n     query.\n\n3. **Additional samples** (for understanding data patterns). On the\n   `find_documents` MCP tool, `limit` and `projection` are nested under the\n   `options` object — they are silently ignored at the top level:\n   ```\n   find_documents({\n     db_name,\n     collection_name,\n     query: {},\n     options: {\n       limit: 4,\n       projection: { \u002F* same secret-field exclusion list as above *\u002F }\n     }\n   })\n   ```\n   - Use these to understand value *shapes* (enum membership, numeric ranges,\n     date formats) — not to memorize specific values.\n   - If any returned value still matches a secret pattern from the *Safety*\n     section, discard it and do not reference it in your output.\n   - **Caveat:** if the MCP server build ignores `options.projection`, the\n     agent-side redaction rules in the *Safety* section are the only line of\n     defense.\n\n   *Note:* the `project` field in the find-query *response* (see Step 3) and\n   the `projection` argument on the MCP `find_documents`\u002F`aggregate` tools\n   are different things — the first shapes the query you emit to the user,\n   the second controls what the MCP server returns to the agent.\n\n### 2. Analyze Context and Validate Fields\n\nBefore generating a query, always validate field names against the schema you\ninferred from sample documents. MongoDB won't error on nonexistent field names —\nit will simply return no results or behave unexpectedly, making bugs hard to\ndiagnose. By checking the schema first, you catch these issues before the user\ntries to run the query.\n\nAlso review the available indexes to understand which query patterns will perform\nbest.\n\n**Redaction check (mandatory):** before drafting the query, scan every value\nyou pulled from `sample_documents` \u002F `find_documents` against the field-name\nand value-pattern lists in the *Safety* section. Discard any matching values\nfrom your working context. The query you generate must contain only:\n\n- field names and types inferred from the schema, and\n- literals supplied by the **user** in their natural-language request, or\n  placeholders like `\u003Cvalue>` when the user hasn't supplied one.\n\nNever inline a sampled value as a filter literal, even if it \"looks safe\".\n\n### 3. Choose Query Type: Find vs Aggregation\n\nPrefer find queries over aggregation pipelines because find queries are simpler\nand easier for other developers to understand.\n\n**For Find Queries**, generate responses with these fields:\n- `filter` — The query filter (required)\n- `project` — Field projection (optional)\n- `sort` — Sort specification (optional)\n- `skip` — Number of documents to skip (optional)\n- `limit` — Number of documents to return (optional)\n\n**Use Find Query when:**\n- Simple filtering on one or more fields\n- Basic sorting and limiting\n\n**For Aggregation Pipelines**, generate an array of stage objects.\n\n**Use Aggregation Pipeline when the request requires:**\n- Grouping or aggregation functions (sum, count, average, etc.)\n- Multiple transformation stages\n- Joins with other collections ($lookup)\n- Array unwinding or complex array operations\n\n### 4. Format Your Response\n\n**Pre-flight redaction check (mandatory):** immediately before serializing\nthe query, re-scan every literal in `filter`, `$in` arrays, regex patterns,\nand projection examples against the secret field-name and value-pattern\nlists in the *Safety* section. Every literal must come from the user's\nnatural-language request or be a placeholder (`\u003Cvalue>`) — never from a\nsampled document.\n\nAlways output queries in a JSON response structure with stringified MongoDB\nquery syntax. The outer response must be valid JSON, while the query strings\ninside use MongoDB shell\u002FExtended JSON syntax for readability.\n\n**Find Query Response:**\n```json\n{\n  \"query\": {\n    \"filter\": \"{ age: { $gte: 25 } }\",\n    \"project\": \"{ name: 1, age: 1, _id: 0 }\",\n    \"sort\": \"{ age: -1 }\",\n    \"limit\": \"10\"\n  }\n}\n```\n\n**Aggregation Pipeline Response:**\n```json\n{\n  \"aggregation\": {\n    \"pipeline\": \"[{ $match: { status: 'active' } }, { $group: { _id: '$category', total: { $sum: '$amount' } } }]\"\n  }\n}\n```\n\nNote the stringified format:\n- Correct: `\"{ age: { $gte: 25 } }\"` (string)\n- Incorrect: `{ age: { $gte: 25 } }` (object)\n\n## Azure DocumentDB Compatibility Notes\n\nAzure DocumentDB has high compatibility with MongoDB wire\nprotocol. Most MongoDB operators and aggregation stages work as expected.\nHowever, be aware of the following:\n\n**Fully Supported:**\n- All standard query operators: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`,\n  `$in`, `$nin`, `$and`, `$or`, `$not`, `$nor`, `$exists`, `$type`, `$regex`\n- Aggregation stages: `$match`, `$group`, `$sort`, `$project`, `$limit`,\n  `$skip`, `$unwind`, `$lookup`, `$addFields`, `$count`, `$facet`\n- Index types: single field, compound, text, geospatial (2dsphere), wildcard\n- Array operators: `$elemMatch`, `$size`, `$all`\n\n**Check Documentation For:**\n- Some advanced aggregation operators may have partial support — always test\n  complex pipelines\n- Vector search capabilities (if using Azure DocumentDB vector search features)\n- Transactions — Azure DocumentDB supports multi-document transactions\n\nFor the authoritative list of supported features, refer to:\nhttps:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fdocumentdb\u002Fcompatibility\n\n## Best Practices\n\n### Query Quality\n1. **Generate correct queries** — Build queries that match user requirements,\n   then check index coverage:\n   - Generate the query to correctly satisfy all user requirements\n   - After generating, check if existing indexes can support it\n   - If no appropriate index exists, mention this in your response\n   - Never use `$where` because it prevents index usage\n   - Do not use `$text` without a text index\n2. **Avoid redundant operators** — Never add operators that are already implied:\n   - Don't add `$exists` when you already have an equality\u002Finequality check\n   - Don't add overlapping range conditions\n3. **Project only needed fields** — Reduce data transfer with projections\n   - Add `_id: 0` to the projection when `_id` field is not needed\n4. **Validate field names** against the schema before using them\n5. **Use appropriate operators** — Choose the right operator for the task:\n   - `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte` for comparisons\n   - `$in`, `$nin` for matching against a list\n   - `$and`, `$or`, `$not`, `$nor` for logical operations\n   - `$regex` for text pattern matching (prefer left-anchored patterns like\n     `\u002F^prefix\u002F` when possible for index efficiency)\n   - `$exists` for field existence checks (prefer `a: {$ne: null}` to\n     `a: {$exists: true}` to leverage indexes)\n6. **Optimize array field checks**:\n   - To check if array is non-empty: use `\"arrayField.0\": {$exists: true}`\n   - For matching array elements with multiple conditions, use `$elemMatch`\n\n### Aggregation Pipeline Quality\n1. **Filter early** — Use `$match` as early as possible\n2. **Project at the end** — Use `$project` at the end to shape output\n3. **Limit when possible** — Add `$limit` after `$sort` when appropriate\n4. **Use indexes** — Ensure `$match` and `$sort` stages can use indexes\n5. **Optimize `$lookup`** — Consider denormalization for frequently joined data\n\n### Error Prevention\n1. **Validate all field references** against the schema\n2. **Quote field names correctly** — Use dot notation for nested fields\n3. **Escape special characters** in regex patterns\n4. **Check data types** — Ensure field values match field types\n5. **Geospatial coordinates** — MongoDB's GeoJSON format requires longitude\n   first, then latitude (`[longitude, latitude]`)\n6. **Never leak sampled values** — Filter literals, `$in` arrays, regex\n   patterns, and projection examples must come from the user's request, not\n   from sampled documents. See the *Safety* section for the full policy.\n\n## Schema Analysis\n\nWhen provided with sample documents, analyze:\n1. **Field types** — String, Number, Boolean, Date, ObjectId, Array, Object\n2. **Field patterns** — Required vs optional fields\n3. **Nested structures** — Objects within objects, arrays of objects\n4. **Array elements** — Homogeneous vs heterogeneous arrays\n5. **Special types** — Dates, ObjectIds, Binary data, GeoJSON\n\n## Error Handling\n\nIf you cannot generate a query:\n1. **Explain why** — Missing schema, ambiguous request, impossible query\n2. **Ask for clarification** — Request more details\n3. **Suggest alternatives** — Propose different approaches\n4. **Provide examples** — Show similar queries that could work\n\n## Example Workflow\n\n**User Input:** \"Find all active users over 25 years old, sorted by\nregistration date\"\n\n**Your Process:**\n1. Check schema for fields: `status`, `age`, `registrationDate` or similar\n2. Verify field types match the query requirements\n3. Generate query based on user requirements\n4. Check if available indexes can support the query\n5. Suggest creating an index if no appropriate index exists\n\n**Generated Query:**\n```json\n{\n  \"query\": {\n    \"filter\": \"{ status: 'active', age: { $gt: 25 } }\",\n    \"sort\": \"{ registrationDate: -1 }\"\n  }\n}\n```\n\n## Size Limits\n\nKeep requests under 5MB:\n- If sample documents are too large, use fewer samples (minimum 1)\n- Limit to 4 sample documents by default\n- For very large documents, project only essential fields when sampling\n",{"data":33,"body":35},{"name":4,"description":6,"allowed-tools":34},"mcp__documentdb__*",{"type":36,"children":37},"root",[38,46,52,59,95,103,584,636,648,654,661,669,702,710,1012,1018,1023,1028,1058,1086,1091,1097,1102,1112,1168,1176,1189,1199,1207,1230,1236,1273,1278,1286,1502,1510,1595,1600,1628,1634,1639,1647,1868,1876,1894,1907,1913,1919,2225,2231,2329,2335,2419,2425,2430,2483,2489,2494,2537,2543,2553,2561,2611,2619,2738,2744,2749,2767],{"type":39,"tag":40,"props":41,"children":42},"element","h1",{"id":4},[43],{"type":44,"value":45},"text","DocumentDB Natural Language Querying",{"type":39,"tag":47,"props":48,"children":49},"p",{},[50],{"type":44,"value":51},"You are an expert query generator for Azure DocumentDB. When\na user requests a query or aggregation pipeline, follow these guidelines to\nproduce correct, efficient queries.",{"type":39,"tag":53,"props":54,"children":56},"h2",{"id":55},"safety-handling-sensitive-data-in-sampled-documents",[57],{"type":44,"value":58},"Safety: Handling Sensitive Data in Sampled Documents",{"type":39,"tag":47,"props":60,"children":61},{},[62,68,70,77,79,85,87,93],{"type":39,"tag":63,"props":64,"children":65},"strong",{},[66],{"type":44,"value":67},"Sampled documents may contain secrets.",{"type":44,"value":69}," Collections frequently hold API\nkeys, OAuth tokens, passwords (hashed or otherwise), connection strings,\nprivate keys, JWTs, session IDs, PII (emails, phone numbers, SSNs, payment\ndata), and internal URLs. The agent MUST treat any value returned by\n",{"type":39,"tag":71,"props":72,"children":74},"code",{"className":73},[],[75],{"type":44,"value":76},"sample_documents",{"type":44,"value":78},", ",{"type":39,"tag":71,"props":80,"children":82},{"className":81},[],[83],{"type":44,"value":84},"find_documents",{"type":44,"value":86},", or ",{"type":39,"tag":71,"props":88,"children":90},{"className":89},[],[91],{"type":44,"value":92},"aggregate",{"type":44,"value":94}," as untrusted and\npotentially sensitive.",{"type":39,"tag":47,"props":96,"children":97},{},[98],{"type":39,"tag":63,"props":99,"children":100},{},[101],{"type":44,"value":102},"Hard rules — never violate:",{"type":39,"tag":104,"props":105,"children":106},"ol",{},[107,148,174,443,519,542,574],{"type":39,"tag":108,"props":109,"children":110},"li",{},[111,116,118,124,126,131,133,139,140,146],{"type":39,"tag":63,"props":112,"children":113},{},[114],{"type":44,"value":115},"Never copy a verbatim value from a sampled document into a generated\nquery, filter, projection, example, comment, or explanation.",{"type":44,"value":117}," Use the\nvalue only to infer the field's ",{"type":39,"tag":119,"props":120,"children":121},"em",{},[122],{"type":44,"value":123},"type",{"type":44,"value":125}," and ",{"type":39,"tag":119,"props":127,"children":128},{},[129],{"type":44,"value":130},"shape",{"type":44,"value":132},", then generate queries\nusing user-supplied literals or parameter placeholders (e.g.\n",{"type":39,"tag":71,"props":134,"children":136},{"className":135},[],[137],{"type":44,"value":138},"\u003CuserEmail>",{"type":44,"value":78},{"type":39,"tag":71,"props":141,"children":143},{"className":142},[],[144],{"type":44,"value":145},"\u003CminAge>",{"type":44,"value":147},").",{"type":39,"tag":108,"props":149,"children":150},{},[151,156,158,164,166,172],{"type":39,"tag":63,"props":152,"children":153},{},[154],{"type":44,"value":155},"Never echo raw sample documents back to the user.",{"type":44,"value":157}," If you must show an\nexample, redact every string\u002Fnumber\u002Fbinary leaf to ",{"type":39,"tag":71,"props":159,"children":161},{"className":160},[],[162],{"type":44,"value":163},"\"\u003Credacted:string>\"",{"type":44,"value":165},",\n",{"type":39,"tag":71,"props":167,"children":169},{"className":168},[],[170],{"type":44,"value":171},"\"\u003Credacted:number>\"",{"type":44,"value":173},", etc., preserving only field names and types.",{"type":39,"tag":108,"props":175,"children":176},{},[177,182,184,190,192],{"type":39,"tag":63,"props":178,"children":179},{},[180],{"type":44,"value":181},"Treat these field-name patterns as secrets and redact unconditionally.",{"type":44,"value":183},"\nMatch case-insensitively after normalizing field names (split on ",{"type":39,"tag":71,"props":185,"children":187},{"className":186},[],[188],{"type":44,"value":189},"_",{"type":44,"value":191}," and\ncamelCase boundaries, lowercase the parts).\n",{"type":39,"tag":193,"props":194,"children":195},"ul",{},[196,361],{"type":39,"tag":108,"props":197,"children":198},{},[199,204,206,212,213,219,220,226,227,233,234,240,241,247,248,254,255,261,262,268,269,275,276,282,283,289,290,296,297,303,304,310,311,317,318,324,325,331,332,338,339,345,346,352,353,359],{"type":39,"tag":63,"props":200,"children":201},{},[202],{"type":44,"value":203},"Substring match",{"type":44,"value":205}," (these tokens are unambiguous; match anywhere in the\nnormalized name): ",{"type":39,"tag":71,"props":207,"children":209},{"className":208},[],[210],{"type":44,"value":211},"password",{"type":44,"value":78},{"type":39,"tag":71,"props":214,"children":216},{"className":215},[],[217],{"type":44,"value":218},"passwd",{"type":44,"value":78},{"type":39,"tag":71,"props":221,"children":223},{"className":222},[],[224],{"type":44,"value":225},"pwd",{"type":44,"value":78},{"type":39,"tag":71,"props":228,"children":230},{"className":229},[],[231],{"type":44,"value":232},"secret",{"type":44,"value":78},{"type":39,"tag":71,"props":235,"children":237},{"className":236},[],[238],{"type":44,"value":239},"apikey",{"type":44,"value":165},{"type":39,"tag":71,"props":242,"children":244},{"className":243},[],[245],{"type":44,"value":246},"api_key",{"type":44,"value":78},{"type":39,"tag":71,"props":249,"children":251},{"className":250},[],[252],{"type":44,"value":253},"accesskey",{"type":44,"value":78},{"type":39,"tag":71,"props":256,"children":258},{"className":257},[],[259],{"type":44,"value":260},"access_key",{"type":44,"value":78},{"type":39,"tag":71,"props":263,"children":265},{"className":264},[],[266],{"type":44,"value":267},"privatekey",{"type":44,"value":78},{"type":39,"tag":71,"props":270,"children":272},{"className":271},[],[273],{"type":44,"value":274},"private_key",{"type":44,"value":165},{"type":39,"tag":71,"props":277,"children":279},{"className":278},[],[280],{"type":44,"value":281},"client_secret",{"type":44,"value":78},{"type":39,"tag":71,"props":284,"children":286},{"className":285},[],[287],{"type":44,"value":288},"refresh_token",{"type":44,"value":78},{"type":39,"tag":71,"props":291,"children":293},{"className":292},[],[294],{"type":44,"value":295},"id_token",{"type":44,"value":78},{"type":39,"tag":71,"props":298,"children":300},{"className":299},[],[301],{"type":44,"value":302},"jwt",{"type":44,"value":78},{"type":39,"tag":71,"props":305,"children":307},{"className":306},[],[308],{"type":44,"value":309},"bearer",{"type":44,"value":165},{"type":39,"tag":71,"props":312,"children":314},{"className":313},[],[315],{"type":44,"value":316},"connectionstring",{"type":44,"value":78},{"type":39,"tag":71,"props":319,"children":321},{"className":320},[],[322],{"type":44,"value":323},"conn_str",{"type":44,"value":78},{"type":39,"tag":71,"props":326,"children":328},{"className":327},[],[329],{"type":44,"value":330},"ssn",{"type":44,"value":78},{"type":39,"tag":71,"props":333,"children":335},{"className":334},[],[336],{"type":44,"value":337},"creditcard",{"type":44,"value":78},{"type":39,"tag":71,"props":340,"children":342},{"className":341},[],[343],{"type":44,"value":344},"card_number",{"type":44,"value":165},{"type":39,"tag":71,"props":347,"children":349},{"className":348},[],[350],{"type":44,"value":351},"cvv",{"type":44,"value":78},{"type":39,"tag":71,"props":354,"children":356},{"className":355},[],[357],{"type":44,"value":358},"token",{"type":44,"value":360},".",{"type":39,"tag":108,"props":362,"children":363},{},[364,369,371,377,378,384,385,391,392,398,400,406,407,413,414,420,421,427,428,434,436,441],{"type":39,"tag":63,"props":365,"children":366},{},[367],{"type":44,"value":368},"Whole-word match only",{"type":44,"value":370}," (these tokens have many benign uses like\n",{"type":39,"tag":71,"props":372,"children":374},{"className":373},[],[375],{"type":44,"value":376},"author",{"type":44,"value":78},{"type":39,"tag":71,"props":379,"children":381},{"className":380},[],[382],{"type":44,"value":383},"session_count",{"type":44,"value":78},{"type":39,"tag":71,"props":386,"children":388},{"className":387},[],[389],{"type":44,"value":390},"pinned",{"type":44,"value":78},{"type":39,"tag":71,"props":393,"children":395},{"className":394},[],[396],{"type":44,"value":397},"shipping_zip",{"type":44,"value":399}," and must not match\nas substrings): ",{"type":39,"tag":71,"props":401,"children":403},{"className":402},[],[404],{"type":44,"value":405},"auth",{"type":44,"value":78},{"type":39,"tag":71,"props":408,"children":410},{"className":409},[],[411],{"type":44,"value":412},"session",{"type":44,"value":78},{"type":39,"tag":71,"props":415,"children":417},{"className":416},[],[418],{"type":44,"value":419},"cookie",{"type":44,"value":78},{"type":39,"tag":71,"props":422,"children":424},{"className":423},[],[425],{"type":44,"value":426},"pin",{"type":44,"value":78},{"type":39,"tag":71,"props":429,"children":431},{"className":430},[],[432],{"type":44,"value":433},"dsn",{"type":44,"value":435},". Redact only\nwhen the normalized name has the token as a standalone part — or when\nthe ",{"type":39,"tag":119,"props":437,"children":438},{},[439],{"type":44,"value":440},"value",{"type":44,"value":442}," also matches one of the patterns in rule 4.",{"type":39,"tag":108,"props":444,"children":445},{},[446,451,453,459,460,466,467,473,475,480,482,488,489,495,496,502,504,510,512,517],{"type":39,"tag":63,"props":447,"children":448},{},[449],{"type":44,"value":450},"Treat these value patterns as secrets",{"type":44,"value":452}," even if the field name looks\nbenign: anything matching ",{"type":39,"tag":71,"props":454,"children":456},{"className":455},[],[457],{"type":44,"value":458},"mongodb(\\+srv)?:\u002F\u002F",{"type":44,"value":78},{"type":39,"tag":71,"props":461,"children":463},{"className":462},[],[464],{"type":44,"value":465},"https?:\u002F\u002F[^ ]*:[^ ]*@",{"type":44,"value":165},{"type":39,"tag":71,"props":468,"children":470},{"className":469},[],[471],{"type":44,"value":472},"eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+",{"type":44,"value":474}," (JWT: three\nbase64url segments separated by ",{"type":39,"tag":71,"props":476,"children":478},{"className":477},[],[479],{"type":44,"value":360},{"type":44,"value":481},"), ",{"type":39,"tag":71,"props":483,"children":485},{"className":484},[],[486],{"type":44,"value":487},"sk-[A-Za-z0-9]{20,}",{"type":44,"value":165},{"type":39,"tag":71,"props":490,"children":492},{"className":491},[],[493],{"type":44,"value":494},"ghp_[A-Za-z0-9]{20,}",{"type":44,"value":78},{"type":39,"tag":71,"props":497,"children":499},{"className":498},[],[500],{"type":44,"value":501},"AKIA[0-9A-Z]{16}",{"type":44,"value":503},", PEM blocks (",{"type":39,"tag":71,"props":505,"children":507},{"className":506},[],[508],{"type":44,"value":509},"-----BEGIN",{"type":44,"value":511},"), or\nany base64\u002Fhex string ≥ 32 characters that does ",{"type":39,"tag":63,"props":513,"children":514},{},[515],{"type":44,"value":516},"not",{"type":44,"value":518}," match a known\nnon-secret shape (UUID v4, 24-char MongoDB ObjectId, SHA-1\u002FSHA-256 hex\ndigest, ISO-8601 timestamp). For the last category, when in doubt, ask\nthe user before using the value rather than silently redacting.",{"type":39,"tag":108,"props":520,"children":521},{},[522,527,529],{"type":39,"tag":63,"props":523,"children":524},{},[525],{"type":44,"value":526},"If the user's natural-language request asks you to filter\u002Freturn a value\nthat matches a secret pattern, refuse and ask for confirmation",{"type":44,"value":528}," before\ngenerating the query. \"Refuse\" means: do not inline the value into the\ngenerated query, and respond with something like ",{"type":39,"tag":119,"props":530,"children":531},{},[532,534,540],{"type":44,"value":533},"\"The value you supplied\nlooks like a JWT\u002FAPI key\u002Fconnection string. Confirm you want me to use it\nliterally — otherwise replace it with a placeholder like ",{"type":39,"tag":71,"props":535,"children":537},{"className":536},[],[538],{"type":44,"value":539},"\u003Ctoken>",{"type":44,"value":541}," and I\nwill generate the query against that.\"",{"type":39,"tag":108,"props":543,"children":544},{},[545,550,552,557,559,564,566,572],{"type":39,"tag":63,"props":546,"children":547},{},[548],{"type":44,"value":549},"Project away suspected secret fields",{"type":44,"value":551}," when generating ",{"type":39,"tag":71,"props":553,"children":555},{"className":554},[],[556],{"type":44,"value":84},{"type":44,"value":558},"\nor ",{"type":39,"tag":71,"props":560,"children":562},{"className":561},[],[563],{"type":44,"value":76},{"type":44,"value":565}," calls for context-gathering — e.g. add\n",{"type":39,"tag":71,"props":567,"children":569},{"className":568},[],[570],{"type":44,"value":571},"{ password: 0, token: 0, apiKey: 0, secret: 0 }",{"type":44,"value":573}," to the projection.",{"type":39,"tag":108,"props":575,"children":576},{},[577,582],{"type":39,"tag":63,"props":578,"children":579},{},[580],{"type":44,"value":581},"Do not transmit sampled values outside the current session",{"type":44,"value":583}," (no\nlogging, no telemetry, no writing to disk).",{"type":39,"tag":47,"props":585,"children":586},{},[587,592,594,599,601,606,608,613,615,620,622,634],{"type":39,"tag":63,"props":588,"children":589},{},[590],{"type":44,"value":591},"Context-gathering vs. user-requested results.",{"type":44,"value":593}," These rules apply to\nvalues the agent pulled into its own context to ",{"type":39,"tag":119,"props":595,"children":596},{},[597],{"type":44,"value":598},"infer schema",{"type":44,"value":600}," (rules 1, 2,\n6). When the user explicitly asks to ",{"type":39,"tag":119,"props":602,"children":603},{},[604],{"type":44,"value":605},"see",{"type":44,"value":607}," data — e.g. ",{"type":39,"tag":119,"props":609,"children":610},{},[611],{"type":44,"value":612},"\"show me the most\nrecent 10 orders\"",{"type":44,"value":614}," or ",{"type":39,"tag":119,"props":616,"children":617},{},[618],{"type":44,"value":619},"\"what does a typical user document look like?\"",{"type":44,"value":621}," —\ngenerate the query and let the MCP tool return results directly to the user.\nDo not redact those results in transit; the user already has database\naccess. The exception is rules 3 and 4: if a returned value matches a\nsecret field name or value pattern, flag it in the response (",{"type":39,"tag":119,"props":623,"children":624},{},[625,627,632],{"type":44,"value":626},"\"The ",{"type":39,"tag":71,"props":628,"children":630},{"className":629},[],[631],{"type":44,"value":358},{"type":44,"value":633},"\nfield in result 3 looks like a JWT — make sure you intended to surface\nit.\"",{"type":44,"value":635},") but do not block the query.",{"type":39,"tag":47,"props":637,"children":638},{},[639,641,646],{"type":44,"value":640},"When in doubt, infer the schema from field ",{"type":39,"tag":119,"props":642,"children":643},{},[644],{"type":44,"value":645},"names and types only",{"type":44,"value":647}," and ask the\nuser to supply concrete filter values themselves.",{"type":39,"tag":53,"props":649,"children":651},{"id":650},"query-generation-process",[652],{"type":44,"value":653},"Query Generation Process",{"type":39,"tag":655,"props":656,"children":658},"h3",{"id":657},"_1-gather-context-using-mcp-tools",[659],{"type":44,"value":660},"1. Gather Context Using MCP Tools",{"type":39,"tag":47,"props":662,"children":663},{},[664],{"type":39,"tag":63,"props":665,"children":666},{},[667],{"type":44,"value":668},"Required Information:",{"type":39,"tag":193,"props":670,"children":671},{},[672,692,697],{"type":39,"tag":108,"props":673,"children":674},{},[675,677,683,684,690],{"type":44,"value":676},"Database name and collection name (use ",{"type":39,"tag":71,"props":678,"children":680},{"className":679},[],[681],{"type":44,"value":682},"list_databases",{"type":44,"value":125},{"type":39,"tag":71,"props":685,"children":687},{"className":686},[],[688],{"type":44,"value":689},"get_db_info",{"type":44,"value":691}," if\nnot provided)",{"type":39,"tag":108,"props":693,"children":694},{},[695],{"type":44,"value":696},"User's natural language description of the query",{"type":39,"tag":108,"props":698,"children":699},{},[700],{"type":44,"value":701},"Current date context: ${currentDate} (for date-relative queries)",{"type":39,"tag":47,"props":703,"children":704},{},[705],{"type":39,"tag":63,"props":706,"children":707},{},[708],{"type":44,"value":709},"Fetch in this order:",{"type":39,"tag":104,"props":711,"children":712},{},[713,735,869],{"type":39,"tag":108,"props":714,"children":715},{},[716,721,723],{"type":39,"tag":63,"props":717,"children":718},{},[719],{"type":44,"value":720},"Indexes",{"type":44,"value":722}," (for query optimization):",{"type":39,"tag":724,"props":725,"children":729},"pre",{"className":726,"code":728,"language":44},[727],"language-text","list_indexes({ db_name, collection_name })\n",[730],{"type":39,"tag":71,"props":731,"children":733},{"__ignoreMap":732},"",[734],{"type":44,"value":728},{"type":39,"tag":108,"props":736,"children":737},{},[738,743,745,750,752,756,758,764,766,772,774,780,782,788,790,795,797,806],{"type":39,"tag":63,"props":739,"children":740},{},[741],{"type":44,"value":742},"Schema",{"type":44,"value":744}," (for field validation — infer from sample documents). The\n",{"type":39,"tag":71,"props":746,"children":748},{"className":747},[],[749],{"type":44,"value":76},{"type":44,"value":751}," MCP tool does ",{"type":39,"tag":63,"props":753,"children":754},{},[755],{"type":44,"value":516},{"type":44,"value":757}," accept a ",{"type":39,"tag":71,"props":759,"children":761},{"className":760},[],[762],{"type":44,"value":763},"projection",{"type":44,"value":765}," parameter\n(its server-side implementation is ",{"type":39,"tag":71,"props":767,"children":769},{"className":768},[],[770],{"type":44,"value":771},"aggregate([{ $sample: { size } }])",{"type":44,"value":773},"\nwith no project stage; its native sizing parameter is ",{"type":39,"tag":71,"props":775,"children":777},{"className":776},[],[778],{"type":44,"value":779},"sample_size",{"type":44,"value":781},", not\n",{"type":39,"tag":71,"props":783,"children":785},{"className":784},[],[786],{"type":44,"value":787},"limit",{"type":44,"value":789},"). To push secret-field redaction down to the database, use the\n",{"type":39,"tag":71,"props":791,"children":793},{"className":792},[],[794],{"type":44,"value":92},{"type":44,"value":796}," tool directly:",{"type":39,"tag":724,"props":798,"children":801},{"className":799,"code":800,"language":44},[727],"aggregate({\n  db_name,\n  collection_name,\n  pipeline: [\n    { $sample: { size: 5 } },\n    { $project: { password: 0, passwd: 0, pwd: 0, secret: 0, token: 0,\n                  apiKey: 0, api_key: 0, accessKey: 0, privateKey: 0,\n                  client_secret: 0, refresh_token: 0, id_token: 0,\n                  jwt: 0, connectionString: 0, ssn: 0, creditCard: 0,\n                  cvv: 0 } }\n  ]\n})\n",[802],{"type":39,"tag":71,"props":803,"children":804},{"__ignoreMap":732},[805],{"type":44,"value":800},{"type":39,"tag":193,"props":807,"children":808},{},[809,821,826,838],{"type":39,"tag":108,"props":810,"children":811},{},[812,814,819],{"type":44,"value":813},"Use returned documents ",{"type":39,"tag":63,"props":815,"children":816},{},[817],{"type":44,"value":818},"only",{"type":44,"value":820}," to infer field names and types — never\ncopy concrete values into generated queries or explanations.",{"type":39,"tag":108,"props":822,"children":823},{},[824],{"type":44,"value":825},"Includes nested document structures and array fields.",{"type":39,"tag":108,"props":827,"children":828},{},[829,831,836],{"type":44,"value":830},"See the ",{"type":39,"tag":119,"props":832,"children":833},{},[834],{"type":44,"value":835},"Safety",{"type":44,"value":837}," section above for the full redaction policy.",{"type":39,"tag":108,"props":839,"children":840},{},[841,846,848,854,856,861,863,867],{"type":39,"tag":63,"props":842,"children":843},{},[844],{"type":44,"value":845},"Caveat:",{"type":44,"value":847}," if the MCP server build in use ignores the ",{"type":39,"tag":71,"props":849,"children":851},{"className":850},[],[852],{"type":44,"value":853},"$project",{"type":44,"value":855}," stage\n(or the user opts to call ",{"type":39,"tag":71,"props":857,"children":859},{"className":858},[],[860],{"type":44,"value":76},{"type":44,"value":862}," directly), the agent-side\nredaction rules in the ",{"type":39,"tag":119,"props":864,"children":865},{},[866],{"type":44,"value":835},{"type":44,"value":868}," section are the only line of defense —\ndiscard secret fields from your working context before drafting any\nquery.",{"type":39,"tag":108,"props":870,"children":871},{},[872,877,879,884,886,891,892,897,899,905,907,916,965,969,974,976,982,984,989,991,996,998,1003,1005,1010],{"type":39,"tag":63,"props":873,"children":874},{},[875],{"type":44,"value":876},"Additional samples",{"type":44,"value":878}," (for understanding data patterns). On the\n",{"type":39,"tag":71,"props":880,"children":882},{"className":881},[],[883],{"type":44,"value":84},{"type":44,"value":885}," MCP tool, ",{"type":39,"tag":71,"props":887,"children":889},{"className":888},[],[890],{"type":44,"value":787},{"type":44,"value":125},{"type":39,"tag":71,"props":893,"children":895},{"className":894},[],[896],{"type":44,"value":763},{"type":44,"value":898}," are nested under the\n",{"type":39,"tag":71,"props":900,"children":902},{"className":901},[],[903],{"type":44,"value":904},"options",{"type":44,"value":906}," object — they are silently ignored at the top level:",{"type":39,"tag":724,"props":908,"children":911},{"className":909,"code":910,"language":44},[727],"find_documents({\n  db_name,\n  collection_name,\n  query: {},\n  options: {\n    limit: 4,\n    projection: { \u002F* same secret-field exclusion list as above *\u002F }\n  }\n})\n",[912],{"type":39,"tag":71,"props":913,"children":914},{"__ignoreMap":732},[915],{"type":44,"value":910},{"type":39,"tag":193,"props":917,"children":918},{},[919,931,942],{"type":39,"tag":108,"props":920,"children":921},{},[922,924,929],{"type":44,"value":923},"Use these to understand value ",{"type":39,"tag":119,"props":925,"children":926},{},[927],{"type":44,"value":928},"shapes",{"type":44,"value":930}," (enum membership, numeric ranges,\ndate formats) — not to memorize specific values.",{"type":39,"tag":108,"props":932,"children":933},{},[934,936,940],{"type":44,"value":935},"If any returned value still matches a secret pattern from the ",{"type":39,"tag":119,"props":937,"children":938},{},[939],{"type":44,"value":835},{"type":44,"value":941},"\nsection, discard it and do not reference it in your output.",{"type":39,"tag":108,"props":943,"children":944},{},[945,949,951,957,959,963],{"type":39,"tag":63,"props":946,"children":947},{},[948],{"type":44,"value":845},{"type":44,"value":950}," if the MCP server build ignores ",{"type":39,"tag":71,"props":952,"children":954},{"className":953},[],[955],{"type":44,"value":956},"options.projection",{"type":44,"value":958},", the\nagent-side redaction rules in the ",{"type":39,"tag":119,"props":960,"children":961},{},[962],{"type":44,"value":835},{"type":44,"value":964}," section are the only line of\ndefense.",{"type":39,"tag":966,"props":967,"children":968},"br",{},[],{"type":39,"tag":119,"props":970,"children":971},{},[972],{"type":44,"value":973},"Note:",{"type":44,"value":975}," the ",{"type":39,"tag":71,"props":977,"children":979},{"className":978},[],[980],{"type":44,"value":981},"project",{"type":44,"value":983}," field in the find-query ",{"type":39,"tag":119,"props":985,"children":986},{},[987],{"type":44,"value":988},"response",{"type":44,"value":990}," (see Step 3) and\nthe ",{"type":39,"tag":71,"props":992,"children":994},{"className":993},[],[995],{"type":44,"value":763},{"type":44,"value":997}," argument on the MCP ",{"type":39,"tag":71,"props":999,"children":1001},{"className":1000},[],[1002],{"type":44,"value":84},{"type":44,"value":1004},"\u002F",{"type":39,"tag":71,"props":1006,"children":1008},{"className":1007},[],[1009],{"type":44,"value":92},{"type":44,"value":1011}," tools\nare different things — the first shapes the query you emit to the user,\nthe second controls what the MCP server returns to the agent.",{"type":39,"tag":655,"props":1013,"children":1015},{"id":1014},"_2-analyze-context-and-validate-fields",[1016],{"type":44,"value":1017},"2. Analyze Context and Validate Fields",{"type":39,"tag":47,"props":1019,"children":1020},{},[1021],{"type":44,"value":1022},"Before generating a query, always validate field names against the schema you\ninferred from sample documents. MongoDB won't error on nonexistent field names —\nit will simply return no results or behave unexpectedly, making bugs hard to\ndiagnose. By checking the schema first, you catch these issues before the user\ntries to run the query.",{"type":39,"tag":47,"props":1024,"children":1025},{},[1026],{"type":44,"value":1027},"Also review the available indexes to understand which query patterns will perform\nbest.",{"type":39,"tag":47,"props":1029,"children":1030},{},[1031,1036,1038,1043,1045,1050,1052,1056],{"type":39,"tag":63,"props":1032,"children":1033},{},[1034],{"type":44,"value":1035},"Redaction check (mandatory):",{"type":44,"value":1037}," before drafting the query, scan every value\nyou pulled from ",{"type":39,"tag":71,"props":1039,"children":1041},{"className":1040},[],[1042],{"type":44,"value":76},{"type":44,"value":1044}," \u002F ",{"type":39,"tag":71,"props":1046,"children":1048},{"className":1047},[],[1049],{"type":44,"value":84},{"type":44,"value":1051}," against the field-name\nand value-pattern lists in the ",{"type":39,"tag":119,"props":1053,"children":1054},{},[1055],{"type":44,"value":835},{"type":44,"value":1057}," section. Discard any matching values\nfrom your working context. The query you generate must contain only:",{"type":39,"tag":193,"props":1059,"children":1060},{},[1061,1066],{"type":39,"tag":108,"props":1062,"children":1063},{},[1064],{"type":44,"value":1065},"field names and types inferred from the schema, and",{"type":39,"tag":108,"props":1067,"children":1068},{},[1069,1071,1076,1078,1084],{"type":44,"value":1070},"literals supplied by the ",{"type":39,"tag":63,"props":1072,"children":1073},{},[1074],{"type":44,"value":1075},"user",{"type":44,"value":1077}," in their natural-language request, or\nplaceholders like ",{"type":39,"tag":71,"props":1079,"children":1081},{"className":1080},[],[1082],{"type":44,"value":1083},"\u003Cvalue>",{"type":44,"value":1085}," when the user hasn't supplied one.",{"type":39,"tag":47,"props":1087,"children":1088},{},[1089],{"type":44,"value":1090},"Never inline a sampled value as a filter literal, even if it \"looks safe\".",{"type":39,"tag":655,"props":1092,"children":1094},{"id":1093},"_3-choose-query-type-find-vs-aggregation",[1095],{"type":44,"value":1096},"3. Choose Query Type: Find vs Aggregation",{"type":39,"tag":47,"props":1098,"children":1099},{},[1100],{"type":44,"value":1101},"Prefer find queries over aggregation pipelines because find queries are simpler\nand easier for other developers to understand.",{"type":39,"tag":47,"props":1103,"children":1104},{},[1105,1110],{"type":39,"tag":63,"props":1106,"children":1107},{},[1108],{"type":44,"value":1109},"For Find Queries",{"type":44,"value":1111},", generate responses with these fields:",{"type":39,"tag":193,"props":1113,"children":1114},{},[1115,1126,1136,1147,1158],{"type":39,"tag":108,"props":1116,"children":1117},{},[1118,1124],{"type":39,"tag":71,"props":1119,"children":1121},{"className":1120},[],[1122],{"type":44,"value":1123},"filter",{"type":44,"value":1125}," — The query filter (required)",{"type":39,"tag":108,"props":1127,"children":1128},{},[1129,1134],{"type":39,"tag":71,"props":1130,"children":1132},{"className":1131},[],[1133],{"type":44,"value":981},{"type":44,"value":1135}," — Field projection (optional)",{"type":39,"tag":108,"props":1137,"children":1138},{},[1139,1145],{"type":39,"tag":71,"props":1140,"children":1142},{"className":1141},[],[1143],{"type":44,"value":1144},"sort",{"type":44,"value":1146}," — Sort specification (optional)",{"type":39,"tag":108,"props":1148,"children":1149},{},[1150,1156],{"type":39,"tag":71,"props":1151,"children":1153},{"className":1152},[],[1154],{"type":44,"value":1155},"skip",{"type":44,"value":1157}," — Number of documents to skip (optional)",{"type":39,"tag":108,"props":1159,"children":1160},{},[1161,1166],{"type":39,"tag":71,"props":1162,"children":1164},{"className":1163},[],[1165],{"type":44,"value":787},{"type":44,"value":1167}," — Number of documents to return (optional)",{"type":39,"tag":47,"props":1169,"children":1170},{},[1171],{"type":39,"tag":63,"props":1172,"children":1173},{},[1174],{"type":44,"value":1175},"Use Find Query when:",{"type":39,"tag":193,"props":1177,"children":1178},{},[1179,1184],{"type":39,"tag":108,"props":1180,"children":1181},{},[1182],{"type":44,"value":1183},"Simple filtering on one or more fields",{"type":39,"tag":108,"props":1185,"children":1186},{},[1187],{"type":44,"value":1188},"Basic sorting and limiting",{"type":39,"tag":47,"props":1190,"children":1191},{},[1192,1197],{"type":39,"tag":63,"props":1193,"children":1194},{},[1195],{"type":44,"value":1196},"For Aggregation Pipelines",{"type":44,"value":1198},", generate an array of stage objects.",{"type":39,"tag":47,"props":1200,"children":1201},{},[1202],{"type":39,"tag":63,"props":1203,"children":1204},{},[1205],{"type":44,"value":1206},"Use Aggregation Pipeline when the request requires:",{"type":39,"tag":193,"props":1208,"children":1209},{},[1210,1215,1220,1225],{"type":39,"tag":108,"props":1211,"children":1212},{},[1213],{"type":44,"value":1214},"Grouping or aggregation functions (sum, count, average, etc.)",{"type":39,"tag":108,"props":1216,"children":1217},{},[1218],{"type":44,"value":1219},"Multiple transformation stages",{"type":39,"tag":108,"props":1221,"children":1222},{},[1223],{"type":44,"value":1224},"Joins with other collections ($lookup)",{"type":39,"tag":108,"props":1226,"children":1227},{},[1228],{"type":44,"value":1229},"Array unwinding or complex array operations",{"type":39,"tag":655,"props":1231,"children":1233},{"id":1232},"_4-format-your-response",[1234],{"type":44,"value":1235},"4. Format Your Response",{"type":39,"tag":47,"props":1237,"children":1238},{},[1239,1244,1246,1251,1252,1258,1260,1264,1266,1271],{"type":39,"tag":63,"props":1240,"children":1241},{},[1242],{"type":44,"value":1243},"Pre-flight redaction check (mandatory):",{"type":44,"value":1245}," immediately before serializing\nthe query, re-scan every literal in ",{"type":39,"tag":71,"props":1247,"children":1249},{"className":1248},[],[1250],{"type":44,"value":1123},{"type":44,"value":78},{"type":39,"tag":71,"props":1253,"children":1255},{"className":1254},[],[1256],{"type":44,"value":1257},"$in",{"type":44,"value":1259}," arrays, regex patterns,\nand projection examples against the secret field-name and value-pattern\nlists in the ",{"type":39,"tag":119,"props":1261,"children":1262},{},[1263],{"type":44,"value":835},{"type":44,"value":1265}," section. Every literal must come from the user's\nnatural-language request or be a placeholder (",{"type":39,"tag":71,"props":1267,"children":1269},{"className":1268},[],[1270],{"type":44,"value":1083},{"type":44,"value":1272},") — never from a\nsampled document.",{"type":39,"tag":47,"props":1274,"children":1275},{},[1276],{"type":44,"value":1277},"Always output queries in a JSON response structure with stringified MongoDB\nquery syntax. The outer response must be valid JSON, while the query strings\ninside use MongoDB shell\u002FExtended JSON syntax for readability.",{"type":39,"tag":47,"props":1279,"children":1280},{},[1281],{"type":39,"tag":63,"props":1282,"children":1283},{},[1284],{"type":44,"value":1285},"Find Query Response:",{"type":39,"tag":724,"props":1287,"children":1291},{"className":1288,"code":1289,"language":1290,"meta":732,"style":732},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"query\": {\n    \"filter\": \"{ age: { $gte: 25 } }\",\n    \"project\": \"{ name: 1, age: 1, _id: 0 }\",\n    \"sort\": \"{ age: -1 }\",\n    \"limit\": \"10\"\n  }\n}\n","json",[1292],{"type":39,"tag":71,"props":1293,"children":1294},{"__ignoreMap":732},[1295,1307,1337,1378,1415,1451,1485,1493],{"type":39,"tag":1296,"props":1297,"children":1300},"span",{"class":1298,"line":1299},"line",1,[1301],{"type":39,"tag":1296,"props":1302,"children":1304},{"style":1303},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[1305],{"type":44,"value":1306},"{\n",{"type":39,"tag":1296,"props":1308,"children":1310},{"class":1298,"line":1309},2,[1311,1316,1322,1327,1332],{"type":39,"tag":1296,"props":1312,"children":1313},{"style":1303},[1314],{"type":44,"value":1315},"  \"",{"type":39,"tag":1296,"props":1317,"children":1319},{"style":1318},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1320],{"type":44,"value":1321},"query",{"type":39,"tag":1296,"props":1323,"children":1324},{"style":1303},[1325],{"type":44,"value":1326},"\"",{"type":39,"tag":1296,"props":1328,"children":1329},{"style":1303},[1330],{"type":44,"value":1331},":",{"type":39,"tag":1296,"props":1333,"children":1334},{"style":1303},[1335],{"type":44,"value":1336}," {\n",{"type":39,"tag":1296,"props":1338,"children":1340},{"class":1298,"line":1339},3,[1341,1346,1351,1355,1359,1364,1370,1374],{"type":39,"tag":1296,"props":1342,"children":1343},{"style":1303},[1344],{"type":44,"value":1345},"    \"",{"type":39,"tag":1296,"props":1347,"children":1349},{"style":1348},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1350],{"type":44,"value":1123},{"type":39,"tag":1296,"props":1352,"children":1353},{"style":1303},[1354],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1356,"children":1357},{"style":1303},[1358],{"type":44,"value":1331},{"type":39,"tag":1296,"props":1360,"children":1361},{"style":1303},[1362],{"type":44,"value":1363}," \"",{"type":39,"tag":1296,"props":1365,"children":1367},{"style":1366},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[1368],{"type":44,"value":1369},"{ age: { $gte: 25 } }",{"type":39,"tag":1296,"props":1371,"children":1372},{"style":1303},[1373],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1375,"children":1376},{"style":1303},[1377],{"type":44,"value":165},{"type":39,"tag":1296,"props":1379,"children":1381},{"class":1298,"line":1380},4,[1382,1386,1390,1394,1398,1402,1407,1411],{"type":39,"tag":1296,"props":1383,"children":1384},{"style":1303},[1385],{"type":44,"value":1345},{"type":39,"tag":1296,"props":1387,"children":1388},{"style":1348},[1389],{"type":44,"value":981},{"type":39,"tag":1296,"props":1391,"children":1392},{"style":1303},[1393],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1395,"children":1396},{"style":1303},[1397],{"type":44,"value":1331},{"type":39,"tag":1296,"props":1399,"children":1400},{"style":1303},[1401],{"type":44,"value":1363},{"type":39,"tag":1296,"props":1403,"children":1404},{"style":1366},[1405],{"type":44,"value":1406},"{ name: 1, age: 1, _id: 0 }",{"type":39,"tag":1296,"props":1408,"children":1409},{"style":1303},[1410],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1412,"children":1413},{"style":1303},[1414],{"type":44,"value":165},{"type":39,"tag":1296,"props":1416,"children":1417},{"class":1298,"line":21},[1418,1422,1426,1430,1434,1438,1443,1447],{"type":39,"tag":1296,"props":1419,"children":1420},{"style":1303},[1421],{"type":44,"value":1345},{"type":39,"tag":1296,"props":1423,"children":1424},{"style":1348},[1425],{"type":44,"value":1144},{"type":39,"tag":1296,"props":1427,"children":1428},{"style":1303},[1429],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1431,"children":1432},{"style":1303},[1433],{"type":44,"value":1331},{"type":39,"tag":1296,"props":1435,"children":1436},{"style":1303},[1437],{"type":44,"value":1363},{"type":39,"tag":1296,"props":1439,"children":1440},{"style":1366},[1441],{"type":44,"value":1442},"{ age: -1 }",{"type":39,"tag":1296,"props":1444,"children":1445},{"style":1303},[1446],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1448,"children":1449},{"style":1303},[1450],{"type":44,"value":165},{"type":39,"tag":1296,"props":1452,"children":1454},{"class":1298,"line":1453},6,[1455,1459,1463,1467,1471,1475,1480],{"type":39,"tag":1296,"props":1456,"children":1457},{"style":1303},[1458],{"type":44,"value":1345},{"type":39,"tag":1296,"props":1460,"children":1461},{"style":1348},[1462],{"type":44,"value":787},{"type":39,"tag":1296,"props":1464,"children":1465},{"style":1303},[1466],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1468,"children":1469},{"style":1303},[1470],{"type":44,"value":1331},{"type":39,"tag":1296,"props":1472,"children":1473},{"style":1303},[1474],{"type":44,"value":1363},{"type":39,"tag":1296,"props":1476,"children":1477},{"style":1366},[1478],{"type":44,"value":1479},"10",{"type":39,"tag":1296,"props":1481,"children":1482},{"style":1303},[1483],{"type":44,"value":1484},"\"\n",{"type":39,"tag":1296,"props":1486,"children":1487},{"class":1298,"line":25},[1488],{"type":39,"tag":1296,"props":1489,"children":1490},{"style":1303},[1491],{"type":44,"value":1492},"  }\n",{"type":39,"tag":1296,"props":1494,"children":1496},{"class":1298,"line":1495},8,[1497],{"type":39,"tag":1296,"props":1498,"children":1499},{"style":1303},[1500],{"type":44,"value":1501},"}\n",{"type":39,"tag":47,"props":1503,"children":1504},{},[1505],{"type":39,"tag":63,"props":1506,"children":1507},{},[1508],{"type":44,"value":1509},"Aggregation Pipeline Response:",{"type":39,"tag":724,"props":1511,"children":1513},{"className":1288,"code":1512,"language":1290,"meta":732,"style":732},"{\n  \"aggregation\": {\n    \"pipeline\": \"[{ $match: { status: 'active' } }, { $group: { _id: '$category', total: { $sum: '$amount' } } }]\"\n  }\n}\n",[1514],{"type":39,"tag":71,"props":1515,"children":1516},{"__ignoreMap":732},[1517,1524,1548,1581,1588],{"type":39,"tag":1296,"props":1518,"children":1519},{"class":1298,"line":1299},[1520],{"type":39,"tag":1296,"props":1521,"children":1522},{"style":1303},[1523],{"type":44,"value":1306},{"type":39,"tag":1296,"props":1525,"children":1526},{"class":1298,"line":1309},[1527,1531,1536,1540,1544],{"type":39,"tag":1296,"props":1528,"children":1529},{"style":1303},[1530],{"type":44,"value":1315},{"type":39,"tag":1296,"props":1532,"children":1533},{"style":1318},[1534],{"type":44,"value":1535},"aggregation",{"type":39,"tag":1296,"props":1537,"children":1538},{"style":1303},[1539],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1541,"children":1542},{"style":1303},[1543],{"type":44,"value":1331},{"type":39,"tag":1296,"props":1545,"children":1546},{"style":1303},[1547],{"type":44,"value":1336},{"type":39,"tag":1296,"props":1549,"children":1550},{"class":1298,"line":1339},[1551,1555,1560,1564,1568,1572,1577],{"type":39,"tag":1296,"props":1552,"children":1553},{"style":1303},[1554],{"type":44,"value":1345},{"type":39,"tag":1296,"props":1556,"children":1557},{"style":1348},[1558],{"type":44,"value":1559},"pipeline",{"type":39,"tag":1296,"props":1561,"children":1562},{"style":1303},[1563],{"type":44,"value":1326},{"type":39,"tag":1296,"props":1565,"children":1566},{"style":1303},[1567],{"type":44,"value":1331},{"type":39,"tag":1296,"props":1569,"children":1570},{"style":1303},[1571],{"type":44,"value":1363},{"type":39,"tag":1296,"props":1573,"children":1574},{"style":1366},[1575],{"type":44,"value":1576},"[{ $match: { status: 'active' } }, { $group: { _id: '$category', total: { $sum: '$amount' } } }]",{"type":39,"tag":1296,"props":1578,"children":1579},{"style":1303},[1580],{"type":44,"value":1484},{"type":39,"tag":1296,"props":1582,"children":1583},{"class":1298,"line":1380},[1584],{"type":39,"tag":1296,"props":1585,"children":1586},{"style":1303},[1587],{"type":44,"value":1492},{"type":39,"tag":1296,"props":1589,"children":1590},{"class":1298,"line":21},[1591],{"type":39,"tag":1296,"props":1592,"children":1593},{"style":1303},[1594],{"type":44,"value":1501},{"type":39,"tag":47,"props":1596,"children":1597},{},[1598],{"type":44,"value":1599},"Note the stringified format:",{"type":39,"tag":193,"props":1601,"children":1602},{},[1603,1616],{"type":39,"tag":108,"props":1604,"children":1605},{},[1606,1608,1614],{"type":44,"value":1607},"Correct: ",{"type":39,"tag":71,"props":1609,"children":1611},{"className":1610},[],[1612],{"type":44,"value":1613},"\"{ age: { $gte: 25 } }\"",{"type":44,"value":1615}," (string)",{"type":39,"tag":108,"props":1617,"children":1618},{},[1619,1621,1626],{"type":44,"value":1620},"Incorrect: ",{"type":39,"tag":71,"props":1622,"children":1624},{"className":1623},[],[1625],{"type":44,"value":1369},{"type":44,"value":1627}," (object)",{"type":39,"tag":53,"props":1629,"children":1631},{"id":1630},"azure-documentdb-compatibility-notes",[1632],{"type":44,"value":1633},"Azure DocumentDB Compatibility Notes",{"type":39,"tag":47,"props":1635,"children":1636},{},[1637],{"type":44,"value":1638},"Azure DocumentDB has high compatibility with MongoDB wire\nprotocol. Most MongoDB operators and aggregation stages work as expected.\nHowever, be aware of the following:",{"type":39,"tag":47,"props":1640,"children":1641},{},[1642],{"type":39,"tag":63,"props":1643,"children":1644},{},[1645],{"type":44,"value":1646},"Fully Supported:",{"type":39,"tag":193,"props":1648,"children":1649},{},[1650,1758,1838,1843],{"type":39,"tag":108,"props":1651,"children":1652},{},[1653,1655,1661,1662,1668,1669,1675,1676,1682,1683,1689,1690,1696,1697,1702,1703,1709,1710,1716,1717,1723,1724,1730,1731,1737,1738,1744,1745,1751,1752],{"type":44,"value":1654},"All standard query operators: ",{"type":39,"tag":71,"props":1656,"children":1658},{"className":1657},[],[1659],{"type":44,"value":1660},"$eq",{"type":44,"value":78},{"type":39,"tag":71,"props":1663,"children":1665},{"className":1664},[],[1666],{"type":44,"value":1667},"$ne",{"type":44,"value":78},{"type":39,"tag":71,"props":1670,"children":1672},{"className":1671},[],[1673],{"type":44,"value":1674},"$gt",{"type":44,"value":78},{"type":39,"tag":71,"props":1677,"children":1679},{"className":1678},[],[1680],{"type":44,"value":1681},"$gte",{"type":44,"value":78},{"type":39,"tag":71,"props":1684,"children":1686},{"className":1685},[],[1687],{"type":44,"value":1688},"$lt",{"type":44,"value":78},{"type":39,"tag":71,"props":1691,"children":1693},{"className":1692},[],[1694],{"type":44,"value":1695},"$lte",{"type":44,"value":165},{"type":39,"tag":71,"props":1698,"children":1700},{"className":1699},[],[1701],{"type":44,"value":1257},{"type":44,"value":78},{"type":39,"tag":71,"props":1704,"children":1706},{"className":1705},[],[1707],{"type":44,"value":1708},"$nin",{"type":44,"value":78},{"type":39,"tag":71,"props":1711,"children":1713},{"className":1712},[],[1714],{"type":44,"value":1715},"$and",{"type":44,"value":78},{"type":39,"tag":71,"props":1718,"children":1720},{"className":1719},[],[1721],{"type":44,"value":1722},"$or",{"type":44,"value":78},{"type":39,"tag":71,"props":1725,"children":1727},{"className":1726},[],[1728],{"type":44,"value":1729},"$not",{"type":44,"value":78},{"type":39,"tag":71,"props":1732,"children":1734},{"className":1733},[],[1735],{"type":44,"value":1736},"$nor",{"type":44,"value":78},{"type":39,"tag":71,"props":1739,"children":1741},{"className":1740},[],[1742],{"type":44,"value":1743},"$exists",{"type":44,"value":78},{"type":39,"tag":71,"props":1746,"children":1748},{"className":1747},[],[1749],{"type":44,"value":1750},"$type",{"type":44,"value":78},{"type":39,"tag":71,"props":1753,"children":1755},{"className":1754},[],[1756],{"type":44,"value":1757},"$regex",{"type":39,"tag":108,"props":1759,"children":1760},{},[1761,1763,1769,1770,1776,1777,1783,1784,1789,1790,1796,1797,1803,1804,1810,1811,1817,1818,1824,1825,1831,1832],{"type":44,"value":1762},"Aggregation stages: ",{"type":39,"tag":71,"props":1764,"children":1766},{"className":1765},[],[1767],{"type":44,"value":1768},"$match",{"type":44,"value":78},{"type":39,"tag":71,"props":1771,"children":1773},{"className":1772},[],[1774],{"type":44,"value":1775},"$group",{"type":44,"value":78},{"type":39,"tag":71,"props":1778,"children":1780},{"className":1779},[],[1781],{"type":44,"value":1782},"$sort",{"type":44,"value":78},{"type":39,"tag":71,"props":1785,"children":1787},{"className":1786},[],[1788],{"type":44,"value":853},{"type":44,"value":78},{"type":39,"tag":71,"props":1791,"children":1793},{"className":1792},[],[1794],{"type":44,"value":1795},"$limit",{"type":44,"value":165},{"type":39,"tag":71,"props":1798,"children":1800},{"className":1799},[],[1801],{"type":44,"value":1802},"$skip",{"type":44,"value":78},{"type":39,"tag":71,"props":1805,"children":1807},{"className":1806},[],[1808],{"type":44,"value":1809},"$unwind",{"type":44,"value":78},{"type":39,"tag":71,"props":1812,"children":1814},{"className":1813},[],[1815],{"type":44,"value":1816},"$lookup",{"type":44,"value":78},{"type":39,"tag":71,"props":1819,"children":1821},{"className":1820},[],[1822],{"type":44,"value":1823},"$addFields",{"type":44,"value":78},{"type":39,"tag":71,"props":1826,"children":1828},{"className":1827},[],[1829],{"type":44,"value":1830},"$count",{"type":44,"value":78},{"type":39,"tag":71,"props":1833,"children":1835},{"className":1834},[],[1836],{"type":44,"value":1837},"$facet",{"type":39,"tag":108,"props":1839,"children":1840},{},[1841],{"type":44,"value":1842},"Index types: single field, compound, text, geospatial (2dsphere), wildcard",{"type":39,"tag":108,"props":1844,"children":1845},{},[1846,1848,1854,1855,1861,1862],{"type":44,"value":1847},"Array operators: ",{"type":39,"tag":71,"props":1849,"children":1851},{"className":1850},[],[1852],{"type":44,"value":1853},"$elemMatch",{"type":44,"value":78},{"type":39,"tag":71,"props":1856,"children":1858},{"className":1857},[],[1859],{"type":44,"value":1860},"$size",{"type":44,"value":78},{"type":39,"tag":71,"props":1863,"children":1865},{"className":1864},[],[1866],{"type":44,"value":1867},"$all",{"type":39,"tag":47,"props":1869,"children":1870},{},[1871],{"type":39,"tag":63,"props":1872,"children":1873},{},[1874],{"type":44,"value":1875},"Check Documentation For:",{"type":39,"tag":193,"props":1877,"children":1878},{},[1879,1884,1889],{"type":39,"tag":108,"props":1880,"children":1881},{},[1882],{"type":44,"value":1883},"Some advanced aggregation operators may have partial support — always test\ncomplex pipelines",{"type":39,"tag":108,"props":1885,"children":1886},{},[1887],{"type":44,"value":1888},"Vector search capabilities (if using Azure DocumentDB vector search features)",{"type":39,"tag":108,"props":1890,"children":1891},{},[1892],{"type":44,"value":1893},"Transactions — Azure DocumentDB supports multi-document transactions",{"type":39,"tag":47,"props":1895,"children":1896},{},[1897,1899],{"type":44,"value":1898},"For the authoritative list of supported features, refer to:\n",{"type":39,"tag":1900,"props":1901,"children":1905},"a",{"href":1902,"rel":1903},"https:\u002F\u002Flearn.microsoft.com\u002Fazure\u002Fdocumentdb\u002Fcompatibility",[1904],"nofollow",[1906],{"type":44,"value":1902},{"type":39,"tag":53,"props":1908,"children":1910},{"id":1909},"best-practices",[1911],{"type":44,"value":1912},"Best Practices",{"type":39,"tag":655,"props":1914,"children":1916},{"id":1915},"query-quality",[1917],{"type":44,"value":1918},"Query Quality",{"type":39,"tag":104,"props":1920,"children":1921},{},[1922,1976,2006,2040,2050,2191],{"type":39,"tag":108,"props":1923,"children":1924},{},[1925,1930,1932],{"type":39,"tag":63,"props":1926,"children":1927},{},[1928],{"type":44,"value":1929},"Generate correct queries",{"type":44,"value":1931}," — Build queries that match user requirements,\nthen check index coverage:\n",{"type":39,"tag":193,"props":1933,"children":1934},{},[1935,1940,1945,1950,1963],{"type":39,"tag":108,"props":1936,"children":1937},{},[1938],{"type":44,"value":1939},"Generate the query to correctly satisfy all user requirements",{"type":39,"tag":108,"props":1941,"children":1942},{},[1943],{"type":44,"value":1944},"After generating, check if existing indexes can support it",{"type":39,"tag":108,"props":1946,"children":1947},{},[1948],{"type":44,"value":1949},"If no appropriate index exists, mention this in your response",{"type":39,"tag":108,"props":1951,"children":1952},{},[1953,1955,1961],{"type":44,"value":1954},"Never use ",{"type":39,"tag":71,"props":1956,"children":1958},{"className":1957},[],[1959],{"type":44,"value":1960},"$where",{"type":44,"value":1962}," because it prevents index usage",{"type":39,"tag":108,"props":1964,"children":1965},{},[1966,1968,1974],{"type":44,"value":1967},"Do not use ",{"type":39,"tag":71,"props":1969,"children":1971},{"className":1970},[],[1972],{"type":44,"value":1973},"$text",{"type":44,"value":1975}," without a text index",{"type":39,"tag":108,"props":1977,"children":1978},{},[1979,1984,1986],{"type":39,"tag":63,"props":1980,"children":1981},{},[1982],{"type":44,"value":1983},"Avoid redundant operators",{"type":44,"value":1985}," — Never add operators that are already implied:\n",{"type":39,"tag":193,"props":1987,"children":1988},{},[1989,2001],{"type":39,"tag":108,"props":1990,"children":1991},{},[1992,1994,1999],{"type":44,"value":1993},"Don't add ",{"type":39,"tag":71,"props":1995,"children":1997},{"className":1996},[],[1998],{"type":44,"value":1743},{"type":44,"value":2000}," when you already have an equality\u002Finequality check",{"type":39,"tag":108,"props":2002,"children":2003},{},[2004],{"type":44,"value":2005},"Don't add overlapping range conditions",{"type":39,"tag":108,"props":2007,"children":2008},{},[2009,2014,2016],{"type":39,"tag":63,"props":2010,"children":2011},{},[2012],{"type":44,"value":2013},"Project only needed fields",{"type":44,"value":2015}," — Reduce data transfer with projections\n",{"type":39,"tag":193,"props":2017,"children":2018},{},[2019],{"type":39,"tag":108,"props":2020,"children":2021},{},[2022,2024,2030,2032,2038],{"type":44,"value":2023},"Add ",{"type":39,"tag":71,"props":2025,"children":2027},{"className":2026},[],[2028],{"type":44,"value":2029},"_id: 0",{"type":44,"value":2031}," to the projection when ",{"type":39,"tag":71,"props":2033,"children":2035},{"className":2034},[],[2036],{"type":44,"value":2037},"_id",{"type":44,"value":2039}," field is not needed",{"type":39,"tag":108,"props":2041,"children":2042},{},[2043,2048],{"type":39,"tag":63,"props":2044,"children":2045},{},[2046],{"type":44,"value":2047},"Validate field names",{"type":44,"value":2049}," against the schema before using them",{"type":39,"tag":108,"props":2051,"children":2052},{},[2053,2058,2060],{"type":39,"tag":63,"props":2054,"children":2055},{},[2056],{"type":44,"value":2057},"Use appropriate operators",{"type":44,"value":2059}," — Choose the right operator for the task:\n",{"type":39,"tag":193,"props":2061,"children":2062},{},[2063,2103,2119,2147,2165],{"type":39,"tag":108,"props":2064,"children":2065},{},[2066,2071,2072,2077,2078,2083,2084,2089,2090,2095,2096,2101],{"type":39,"tag":71,"props":2067,"children":2069},{"className":2068},[],[2070],{"type":44,"value":1660},{"type":44,"value":78},{"type":39,"tag":71,"props":2073,"children":2075},{"className":2074},[],[2076],{"type":44,"value":1667},{"type":44,"value":78},{"type":39,"tag":71,"props":2079,"children":2081},{"className":2080},[],[2082],{"type":44,"value":1674},{"type":44,"value":78},{"type":39,"tag":71,"props":2085,"children":2087},{"className":2086},[],[2088],{"type":44,"value":1681},{"type":44,"value":78},{"type":39,"tag":71,"props":2091,"children":2093},{"className":2092},[],[2094],{"type":44,"value":1688},{"type":44,"value":78},{"type":39,"tag":71,"props":2097,"children":2099},{"className":2098},[],[2100],{"type":44,"value":1695},{"type":44,"value":2102}," for comparisons",{"type":39,"tag":108,"props":2104,"children":2105},{},[2106,2111,2112,2117],{"type":39,"tag":71,"props":2107,"children":2109},{"className":2108},[],[2110],{"type":44,"value":1257},{"type":44,"value":78},{"type":39,"tag":71,"props":2113,"children":2115},{"className":2114},[],[2116],{"type":44,"value":1708},{"type":44,"value":2118}," for matching against a list",{"type":39,"tag":108,"props":2120,"children":2121},{},[2122,2127,2128,2133,2134,2139,2140,2145],{"type":39,"tag":71,"props":2123,"children":2125},{"className":2124},[],[2126],{"type":44,"value":1715},{"type":44,"value":78},{"type":39,"tag":71,"props":2129,"children":2131},{"className":2130},[],[2132],{"type":44,"value":1722},{"type":44,"value":78},{"type":39,"tag":71,"props":2135,"children":2137},{"className":2136},[],[2138],{"type":44,"value":1729},{"type":44,"value":78},{"type":39,"tag":71,"props":2141,"children":2143},{"className":2142},[],[2144],{"type":44,"value":1736},{"type":44,"value":2146}," for logical operations",{"type":39,"tag":108,"props":2148,"children":2149},{},[2150,2155,2157,2163],{"type":39,"tag":71,"props":2151,"children":2153},{"className":2152},[],[2154],{"type":44,"value":1757},{"type":44,"value":2156}," for text pattern matching (prefer left-anchored patterns like\n",{"type":39,"tag":71,"props":2158,"children":2160},{"className":2159},[],[2161],{"type":44,"value":2162},"\u002F^prefix\u002F",{"type":44,"value":2164}," when possible for index efficiency)",{"type":39,"tag":108,"props":2166,"children":2167},{},[2168,2173,2175,2181,2183,2189],{"type":39,"tag":71,"props":2169,"children":2171},{"className":2170},[],[2172],{"type":44,"value":1743},{"type":44,"value":2174}," for field existence checks (prefer ",{"type":39,"tag":71,"props":2176,"children":2178},{"className":2177},[],[2179],{"type":44,"value":2180},"a: {$ne: null}",{"type":44,"value":2182}," to\n",{"type":39,"tag":71,"props":2184,"children":2186},{"className":2185},[],[2187],{"type":44,"value":2188},"a: {$exists: true}",{"type":44,"value":2190}," to leverage indexes)",{"type":39,"tag":108,"props":2192,"children":2193},{},[2194,2199,2201],{"type":39,"tag":63,"props":2195,"children":2196},{},[2197],{"type":44,"value":2198},"Optimize array field checks",{"type":44,"value":2200},":\n",{"type":39,"tag":193,"props":2202,"children":2203},{},[2204,2215],{"type":39,"tag":108,"props":2205,"children":2206},{},[2207,2209],{"type":44,"value":2208},"To check if array is non-empty: use ",{"type":39,"tag":71,"props":2210,"children":2212},{"className":2211},[],[2213],{"type":44,"value":2214},"\"arrayField.0\": {$exists: true}",{"type":39,"tag":108,"props":2216,"children":2217},{},[2218,2220],{"type":44,"value":2219},"For matching array elements with multiple conditions, use ",{"type":39,"tag":71,"props":2221,"children":2223},{"className":2222},[],[2224],{"type":44,"value":1853},{"type":39,"tag":655,"props":2226,"children":2228},{"id":2227},"aggregation-pipeline-quality",[2229],{"type":44,"value":2230},"Aggregation Pipeline Quality",{"type":39,"tag":104,"props":2232,"children":2233},{},[2234,2251,2267,2291,2314],{"type":39,"tag":108,"props":2235,"children":2236},{},[2237,2242,2244,2249],{"type":39,"tag":63,"props":2238,"children":2239},{},[2240],{"type":44,"value":2241},"Filter early",{"type":44,"value":2243}," — Use ",{"type":39,"tag":71,"props":2245,"children":2247},{"className":2246},[],[2248],{"type":44,"value":1768},{"type":44,"value":2250}," as early as possible",{"type":39,"tag":108,"props":2252,"children":2253},{},[2254,2259,2260,2265],{"type":39,"tag":63,"props":2255,"children":2256},{},[2257],{"type":44,"value":2258},"Project at the end",{"type":44,"value":2243},{"type":39,"tag":71,"props":2261,"children":2263},{"className":2262},[],[2264],{"type":44,"value":853},{"type":44,"value":2266}," at the end to shape output",{"type":39,"tag":108,"props":2268,"children":2269},{},[2270,2275,2277,2282,2284,2289],{"type":39,"tag":63,"props":2271,"children":2272},{},[2273],{"type":44,"value":2274},"Limit when possible",{"type":44,"value":2276}," — Add ",{"type":39,"tag":71,"props":2278,"children":2280},{"className":2279},[],[2281],{"type":44,"value":1795},{"type":44,"value":2283}," after ",{"type":39,"tag":71,"props":2285,"children":2287},{"className":2286},[],[2288],{"type":44,"value":1782},{"type":44,"value":2290}," when appropriate",{"type":39,"tag":108,"props":2292,"children":2293},{},[2294,2299,2301,2306,2307,2312],{"type":39,"tag":63,"props":2295,"children":2296},{},[2297],{"type":44,"value":2298},"Use indexes",{"type":44,"value":2300}," — Ensure ",{"type":39,"tag":71,"props":2302,"children":2304},{"className":2303},[],[2305],{"type":44,"value":1768},{"type":44,"value":125},{"type":39,"tag":71,"props":2308,"children":2310},{"className":2309},[],[2311],{"type":44,"value":1782},{"type":44,"value":2313}," stages can use indexes",{"type":39,"tag":108,"props":2315,"children":2316},{},[2317,2327],{"type":39,"tag":63,"props":2318,"children":2319},{},[2320,2322],{"type":44,"value":2321},"Optimize ",{"type":39,"tag":71,"props":2323,"children":2325},{"className":2324},[],[2326],{"type":44,"value":1816},{"type":44,"value":2328}," — Consider denormalization for frequently joined data",{"type":39,"tag":655,"props":2330,"children":2332},{"id":2331},"error-prevention",[2333],{"type":44,"value":2334},"Error Prevention",{"type":39,"tag":104,"props":2336,"children":2337},{},[2338,2348,2358,2368,2378,2396],{"type":39,"tag":108,"props":2339,"children":2340},{},[2341,2346],{"type":39,"tag":63,"props":2342,"children":2343},{},[2344],{"type":44,"value":2345},"Validate all field references",{"type":44,"value":2347}," against the schema",{"type":39,"tag":108,"props":2349,"children":2350},{},[2351,2356],{"type":39,"tag":63,"props":2352,"children":2353},{},[2354],{"type":44,"value":2355},"Quote field names correctly",{"type":44,"value":2357}," — Use dot notation for nested fields",{"type":39,"tag":108,"props":2359,"children":2360},{},[2361,2366],{"type":39,"tag":63,"props":2362,"children":2363},{},[2364],{"type":44,"value":2365},"Escape special characters",{"type":44,"value":2367}," in regex patterns",{"type":39,"tag":108,"props":2369,"children":2370},{},[2371,2376],{"type":39,"tag":63,"props":2372,"children":2373},{},[2374],{"type":44,"value":2375},"Check data types",{"type":44,"value":2377}," — Ensure field values match field types",{"type":39,"tag":108,"props":2379,"children":2380},{},[2381,2386,2388,2394],{"type":39,"tag":63,"props":2382,"children":2383},{},[2384],{"type":44,"value":2385},"Geospatial coordinates",{"type":44,"value":2387}," — MongoDB's GeoJSON format requires longitude\nfirst, then latitude (",{"type":39,"tag":71,"props":2389,"children":2391},{"className":2390},[],[2392],{"type":44,"value":2393},"[longitude, latitude]",{"type":44,"value":2395},")",{"type":39,"tag":108,"props":2397,"children":2398},{},[2399,2404,2406,2411,2413,2417],{"type":39,"tag":63,"props":2400,"children":2401},{},[2402],{"type":44,"value":2403},"Never leak sampled values",{"type":44,"value":2405}," — Filter literals, ",{"type":39,"tag":71,"props":2407,"children":2409},{"className":2408},[],[2410],{"type":44,"value":1257},{"type":44,"value":2412}," arrays, regex\npatterns, and projection examples must come from the user's request, not\nfrom sampled documents. See the ",{"type":39,"tag":119,"props":2414,"children":2415},{},[2416],{"type":44,"value":835},{"type":44,"value":2418}," section for the full policy.",{"type":39,"tag":53,"props":2420,"children":2422},{"id":2421},"schema-analysis",[2423],{"type":44,"value":2424},"Schema Analysis",{"type":39,"tag":47,"props":2426,"children":2427},{},[2428],{"type":44,"value":2429},"When provided with sample documents, analyze:",{"type":39,"tag":104,"props":2431,"children":2432},{},[2433,2443,2453,2463,2473],{"type":39,"tag":108,"props":2434,"children":2435},{},[2436,2441],{"type":39,"tag":63,"props":2437,"children":2438},{},[2439],{"type":44,"value":2440},"Field types",{"type":44,"value":2442}," — String, Number, Boolean, Date, ObjectId, Array, Object",{"type":39,"tag":108,"props":2444,"children":2445},{},[2446,2451],{"type":39,"tag":63,"props":2447,"children":2448},{},[2449],{"type":44,"value":2450},"Field patterns",{"type":44,"value":2452}," — Required vs optional fields",{"type":39,"tag":108,"props":2454,"children":2455},{},[2456,2461],{"type":39,"tag":63,"props":2457,"children":2458},{},[2459],{"type":44,"value":2460},"Nested structures",{"type":44,"value":2462}," — Objects within objects, arrays of objects",{"type":39,"tag":108,"props":2464,"children":2465},{},[2466,2471],{"type":39,"tag":63,"props":2467,"children":2468},{},[2469],{"type":44,"value":2470},"Array elements",{"type":44,"value":2472}," — Homogeneous vs heterogeneous arrays",{"type":39,"tag":108,"props":2474,"children":2475},{},[2476,2481],{"type":39,"tag":63,"props":2477,"children":2478},{},[2479],{"type":44,"value":2480},"Special types",{"type":44,"value":2482}," — Dates, ObjectIds, Binary data, GeoJSON",{"type":39,"tag":53,"props":2484,"children":2486},{"id":2485},"error-handling",[2487],{"type":44,"value":2488},"Error Handling",{"type":39,"tag":47,"props":2490,"children":2491},{},[2492],{"type":44,"value":2493},"If you cannot generate a query:",{"type":39,"tag":104,"props":2495,"children":2496},{},[2497,2507,2517,2527],{"type":39,"tag":108,"props":2498,"children":2499},{},[2500,2505],{"type":39,"tag":63,"props":2501,"children":2502},{},[2503],{"type":44,"value":2504},"Explain why",{"type":44,"value":2506}," — Missing schema, ambiguous request, impossible query",{"type":39,"tag":108,"props":2508,"children":2509},{},[2510,2515],{"type":39,"tag":63,"props":2511,"children":2512},{},[2513],{"type":44,"value":2514},"Ask for clarification",{"type":44,"value":2516}," — Request more details",{"type":39,"tag":108,"props":2518,"children":2519},{},[2520,2525],{"type":39,"tag":63,"props":2521,"children":2522},{},[2523],{"type":44,"value":2524},"Suggest alternatives",{"type":44,"value":2526}," — Propose different approaches",{"type":39,"tag":108,"props":2528,"children":2529},{},[2530,2535],{"type":39,"tag":63,"props":2531,"children":2532},{},[2533],{"type":44,"value":2534},"Provide examples",{"type":44,"value":2536}," — Show similar queries that could work",{"type":39,"tag":53,"props":2538,"children":2540},{"id":2539},"example-workflow",[2541],{"type":44,"value":2542},"Example Workflow",{"type":39,"tag":47,"props":2544,"children":2545},{},[2546,2551],{"type":39,"tag":63,"props":2547,"children":2548},{},[2549],{"type":44,"value":2550},"User Input:",{"type":44,"value":2552}," \"Find all active users over 25 years old, sorted by\nregistration date\"",{"type":39,"tag":47,"props":2554,"children":2555},{},[2556],{"type":39,"tag":63,"props":2557,"children":2558},{},[2559],{"type":44,"value":2560},"Your Process:",{"type":39,"tag":104,"props":2562,"children":2563},{},[2564,2591,2596,2601,2606],{"type":39,"tag":108,"props":2565,"children":2566},{},[2567,2569,2575,2576,2582,2583,2589],{"type":44,"value":2568},"Check schema for fields: ",{"type":39,"tag":71,"props":2570,"children":2572},{"className":2571},[],[2573],{"type":44,"value":2574},"status",{"type":44,"value":78},{"type":39,"tag":71,"props":2577,"children":2579},{"className":2578},[],[2580],{"type":44,"value":2581},"age",{"type":44,"value":78},{"type":39,"tag":71,"props":2584,"children":2586},{"className":2585},[],[2587],{"type":44,"value":2588},"registrationDate",{"type":44,"value":2590}," or similar",{"type":39,"tag":108,"props":2592,"children":2593},{},[2594],{"type":44,"value":2595},"Verify field types match the query requirements",{"type":39,"tag":108,"props":2597,"children":2598},{},[2599],{"type":44,"value":2600},"Generate query based on user requirements",{"type":39,"tag":108,"props":2602,"children":2603},{},[2604],{"type":44,"value":2605},"Check if available indexes can support the query",{"type":39,"tag":108,"props":2607,"children":2608},{},[2609],{"type":44,"value":2610},"Suggest creating an index if no appropriate index exists",{"type":39,"tag":47,"props":2612,"children":2613},{},[2614],{"type":39,"tag":63,"props":2615,"children":2616},{},[2617],{"type":44,"value":2618},"Generated Query:",{"type":39,"tag":724,"props":2620,"children":2622},{"className":1288,"code":2621,"language":1290,"meta":732,"style":732},"{\n  \"query\": {\n    \"filter\": \"{ status: 'active', age: { $gt: 25 } }\",\n    \"sort\": \"{ registrationDate: -1 }\"\n  }\n}\n",[2623],{"type":39,"tag":71,"props":2624,"children":2625},{"__ignoreMap":732},[2626,2633,2656,2692,2724,2731],{"type":39,"tag":1296,"props":2627,"children":2628},{"class":1298,"line":1299},[2629],{"type":39,"tag":1296,"props":2630,"children":2631},{"style":1303},[2632],{"type":44,"value":1306},{"type":39,"tag":1296,"props":2634,"children":2635},{"class":1298,"line":1309},[2636,2640,2644,2648,2652],{"type":39,"tag":1296,"props":2637,"children":2638},{"style":1303},[2639],{"type":44,"value":1315},{"type":39,"tag":1296,"props":2641,"children":2642},{"style":1318},[2643],{"type":44,"value":1321},{"type":39,"tag":1296,"props":2645,"children":2646},{"style":1303},[2647],{"type":44,"value":1326},{"type":39,"tag":1296,"props":2649,"children":2650},{"style":1303},[2651],{"type":44,"value":1331},{"type":39,"tag":1296,"props":2653,"children":2654},{"style":1303},[2655],{"type":44,"value":1336},{"type":39,"tag":1296,"props":2657,"children":2658},{"class":1298,"line":1339},[2659,2663,2667,2671,2675,2679,2684,2688],{"type":39,"tag":1296,"props":2660,"children":2661},{"style":1303},[2662],{"type":44,"value":1345},{"type":39,"tag":1296,"props":2664,"children":2665},{"style":1348},[2666],{"type":44,"value":1123},{"type":39,"tag":1296,"props":2668,"children":2669},{"style":1303},[2670],{"type":44,"value":1326},{"type":39,"tag":1296,"props":2672,"children":2673},{"style":1303},[2674],{"type":44,"value":1331},{"type":39,"tag":1296,"props":2676,"children":2677},{"style":1303},[2678],{"type":44,"value":1363},{"type":39,"tag":1296,"props":2680,"children":2681},{"style":1366},[2682],{"type":44,"value":2683},"{ status: 'active', age: { $gt: 25 } }",{"type":39,"tag":1296,"props":2685,"children":2686},{"style":1303},[2687],{"type":44,"value":1326},{"type":39,"tag":1296,"props":2689,"children":2690},{"style":1303},[2691],{"type":44,"value":165},{"type":39,"tag":1296,"props":2693,"children":2694},{"class":1298,"line":1380},[2695,2699,2703,2707,2711,2715,2720],{"type":39,"tag":1296,"props":2696,"children":2697},{"style":1303},[2698],{"type":44,"value":1345},{"type":39,"tag":1296,"props":2700,"children":2701},{"style":1348},[2702],{"type":44,"value":1144},{"type":39,"tag":1296,"props":2704,"children":2705},{"style":1303},[2706],{"type":44,"value":1326},{"type":39,"tag":1296,"props":2708,"children":2709},{"style":1303},[2710],{"type":44,"value":1331},{"type":39,"tag":1296,"props":2712,"children":2713},{"style":1303},[2714],{"type":44,"value":1363},{"type":39,"tag":1296,"props":2716,"children":2717},{"style":1366},[2718],{"type":44,"value":2719},"{ registrationDate: -1 }",{"type":39,"tag":1296,"props":2721,"children":2722},{"style":1303},[2723],{"type":44,"value":1484},{"type":39,"tag":1296,"props":2725,"children":2726},{"class":1298,"line":21},[2727],{"type":39,"tag":1296,"props":2728,"children":2729},{"style":1303},[2730],{"type":44,"value":1492},{"type":39,"tag":1296,"props":2732,"children":2733},{"class":1298,"line":1453},[2734],{"type":39,"tag":1296,"props":2735,"children":2736},{"style":1303},[2737],{"type":44,"value":1501},{"type":39,"tag":53,"props":2739,"children":2741},{"id":2740},"size-limits",[2742],{"type":44,"value":2743},"Size Limits",{"type":39,"tag":47,"props":2745,"children":2746},{},[2747],{"type":44,"value":2748},"Keep requests under 5MB:",{"type":39,"tag":193,"props":2750,"children":2751},{},[2752,2757,2762],{"type":39,"tag":108,"props":2753,"children":2754},{},[2755],{"type":44,"value":2756},"If sample documents are too large, use fewer samples (minimum 1)",{"type":39,"tag":108,"props":2758,"children":2759},{},[2760],{"type":44,"value":2761},"Limit to 4 sample documents by default",{"type":39,"tag":108,"props":2763,"children":2764},{},[2765],{"type":44,"value":2766},"For very large documents, project only essential fields when sampling",{"type":39,"tag":2768,"props":2769,"children":2770},"style",{},[2771],{"type":44,"value":2772},"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":2774,"total":2953},[2775,2794,2813,2832,2847,2862,2875,2890,2901,2915,2928,2941],{"slug":2776,"name":2776,"fn":2777,"description":2778,"org":2779,"tags":2780,"stars":2791,"repoUrl":2792,"updatedAt":2793},"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},[2781,2782,2785,2788],{"name":11,"slug":8,"type":14},{"name":2783,"slug":2784,"type":14},"Compliance","compliance",{"name":2786,"slug":2787,"type":14},"Governance","governance",{"name":2789,"slug":2790,"type":14},"Policy","policy",1686,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-policy","2026-07-12T08:17:48.378432",{"slug":2795,"name":2795,"fn":2796,"description":2797,"org":2798,"tags":2799,"stars":2810,"repoUrl":2811,"updatedAt":2812},"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},[2800,2801,2804,2807],{"name":11,"slug":8,"type":14},{"name":2802,"slug":2803,"type":14},"Deployment","deployment",{"name":2805,"slug":2806,"type":14},"Infrastructure as Code","infrastructure-as-code",{"name":2808,"slug":2809,"type":14},"Migration","migration",260,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-blueprints","2026-07-12T08:17:49.646405",{"slug":2814,"name":2814,"fn":2815,"description":2816,"org":2817,"tags":2818,"stars":2829,"repoUrl":2830,"updatedAt":2831},"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},[2819,2822,2823,2826],{"name":2820,"slug":2821,"type":14},"API Development","api-development",{"name":11,"slug":8,"type":14},{"name":2824,"slug":2825,"type":14},"Code Review","code-review",{"name":2827,"slug":2828,"type":14},"Documentation","documentation",133,"https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-tools","2026-07-12T08:17:43.350876",{"slug":2833,"name":2833,"fn":2834,"description":2835,"org":2836,"tags":2837,"stars":2829,"repoUrl":2830,"updatedAt":2846},"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},[2838,2839,2840,2843],{"name":11,"slug":8,"type":14},{"name":2802,"slug":2803,"type":14},{"name":2841,"slug":2842,"type":14},"SDK","sdk",{"name":2844,"slug":2845,"type":14},"Testing","testing","2026-07-12T08:17:44.718943",{"slug":2848,"name":2848,"fn":2849,"description":2850,"org":2851,"tags":2852,"stars":2829,"repoUrl":2830,"updatedAt":2861},"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},[2853,2854,2857,2860],{"name":11,"slug":8,"type":14},{"name":2855,"slug":2856,"type":14},"GitHub","github",{"name":2858,"slug":2859,"type":14},"Project Management","project-management",{"name":2841,"slug":2842,"type":14},"2026-07-12T08:17:38.345387",{"slug":2863,"name":2863,"fn":2864,"description":2865,"org":2866,"tags":2867,"stars":2829,"repoUrl":2830,"updatedAt":2874},"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},[2868,2869,2872,2873],{"name":11,"slug":8,"type":14},{"name":2870,"slug":2871,"type":14},"CI\u002FCD","ci-cd",{"name":2802,"slug":2803,"type":14},{"name":2841,"slug":2842,"type":14},"2026-07-12T08:17:34.27607",{"slug":2876,"name":2876,"fn":2877,"description":2878,"org":2879,"tags":2880,"stars":2829,"repoUrl":2830,"updatedAt":2889},"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},[2881,2882,2883,2886],{"name":2820,"slug":2821,"type":14},{"name":11,"slug":8,"type":14},{"name":2884,"slug":2885,"type":14},"OpenAPI","openapi",{"name":2887,"slug":2888,"type":14},"Technical Writing","technical-writing","2026-07-12T08:17:39.603232",{"slug":2891,"name":2891,"fn":2892,"description":2893,"org":2894,"tags":2895,"stars":2829,"repoUrl":2830,"updatedAt":2900},"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},[2896,2897,2898,2899],{"name":11,"slug":8,"type":14},{"name":2870,"slug":2871,"type":14},{"name":2841,"slug":2842,"type":14},{"name":2844,"slug":2845,"type":14},"2026-07-12T08:17:37.08523",{"slug":2902,"name":2902,"fn":2903,"description":2904,"org":2905,"tags":2906,"stars":2829,"repoUrl":2830,"updatedAt":2914},"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},[2907,2910,2913],{"name":2908,"slug":2909,"type":14},"LLM","llm",{"name":2911,"slug":2912,"type":14},"Performance","performance",{"name":2887,"slug":2888,"type":14},"2026-07-12T08:17:42.080413",{"slug":2916,"name":2916,"fn":2917,"description":2918,"org":2919,"tags":2920,"stars":2829,"repoUrl":2830,"updatedAt":2927},"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},[2921,2922,2923,2926],{"name":11,"slug":8,"type":14},{"name":2870,"slug":2871,"type":14},{"name":2924,"slug":2925,"type":14},"Debugging","debugging",{"name":2841,"slug":2842,"type":14},"2026-07-12T08:17:40.821512",{"slug":2929,"name":2929,"fn":2930,"description":2931,"org":2932,"tags":2933,"stars":2829,"repoUrl":2830,"updatedAt":2940},"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},[2934,2935,2936,2939],{"name":11,"slug":8,"type":14},{"name":2783,"slug":2784,"type":14},{"name":2937,"slug":2938,"type":14},"Process Optimization","process-optimization",{"name":2887,"slug":2888,"type":14},"2026-07-12T08:17:32.970921",{"slug":2942,"name":2942,"fn":2943,"description":2944,"org":2945,"tags":2946,"stars":2829,"repoUrl":2830,"updatedAt":2952},"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},[2947,2948,2951],{"name":2827,"slug":2828,"type":14},{"name":2949,"slug":2950,"type":14},"Plugin Development","plugin-development",{"name":2887,"slug":2888,"type":14},"2026-07-12T08:17:35.873862",109,{"items":2955,"total":3049},[2956,2975,2985,2998,3009,3021,3034],{"slug":2957,"name":2957,"fn":2958,"description":2959,"org":2960,"tags":2961,"stars":21,"repoUrl":22,"updatedAt":2974},"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},[2962,2963,2966,2969,2970,2971],{"name":11,"slug":8,"type":14},{"name":2964,"slug":2965,"type":14},"Bicep","bicep",{"name":2967,"slug":2968,"type":14},"CLI","cli",{"name":19,"slug":20,"type":14},{"name":2802,"slug":2803,"type":14},{"name":2972,"slug":2973,"type":14},"Terraform","terraform","2026-07-12T08:18:56.861159",{"slug":2976,"name":2976,"fn":2977,"description":2978,"org":2979,"tags":2980,"stars":21,"repoUrl":22,"updatedAt":2984},"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},[2981,2982,2983],{"name":11,"slug":8,"type":14},{"name":19,"slug":20,"type":14},{"name":2911,"slug":2912,"type":14},"2026-07-12T08:18:49.875358",{"slug":2986,"name":2986,"fn":2987,"description":2988,"org":2989,"tags":2990,"stars":21,"repoUrl":22,"updatedAt":2997},"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},[2991,2992,2995,2996],{"name":11,"slug":8,"type":14},{"name":2993,"slug":2994,"type":14},"Data Modeling","data-modeling",{"name":19,"slug":20,"type":14},{"name":16,"slug":17,"type":14},"2026-08-01T05:42:33.42955",{"slug":2999,"name":2999,"fn":3000,"description":3001,"org":3002,"tags":3003,"stars":21,"repoUrl":22,"updatedAt":3008},"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},[3004,3005,3006,3007],{"name":11,"slug":8,"type":14},{"name":19,"slug":20,"type":14},{"name":16,"slug":17,"type":14},{"name":2841,"slug":2842,"type":14},"2026-07-12T08:18:42.136316",{"slug":3010,"name":3010,"fn":3011,"description":3012,"org":3013,"tags":3014,"stars":21,"repoUrl":22,"updatedAt":3020},"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},[3015,3016,3017],{"name":11,"slug":8,"type":14},{"name":19,"slug":20,"type":14},{"name":3018,"slug":3019,"type":14},"Search","search","2026-07-15T06:02:41.270913",{"slug":3022,"name":3022,"fn":3023,"description":3024,"org":3025,"tags":3026,"stars":21,"repoUrl":22,"updatedAt":3033},"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},[3027,3028,3029,3032],{"name":11,"slug":8,"type":14},{"name":19,"slug":20,"type":14},{"name":3030,"slug":3031,"type":14},"Operations","operations",{"name":2911,"slug":2912,"type":14},"2026-07-12T08:18:53.654505",{"slug":3035,"name":3035,"fn":3036,"description":3037,"org":3038,"tags":3039,"stars":21,"repoUrl":22,"updatedAt":3048},"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},[3040,3041,3044,3045],{"name":11,"slug":8,"type":14},{"name":3042,"slug":3043,"type":14},"Cosmos DB","cosmos-db",{"name":19,"slug":20,"type":14},{"name":3046,"slug":3047,"type":14},"NoSQL","nosql","2026-07-12T08:18:44.753904",17]