Fix non-functional sample code and remove orphaned stub pages - #71
Merged
guanzhousongmicrosoft merged 1 commit intoAug 25, 2026
Conversation
Six parallel reviews scored this repo against a written documentation standard. The reference core (postgres-api, api-reference, documentdb-local, kubernetes-operator) scored well; getting-started, where a new user lands, did not. One reviewer executed the samples against a live gateway rather than reading them, and python-setup.md failed six different ways. python-setup.md: datetime.utcnow() was used 43 lines before its import, so a copy-paste raised NameError; initialize_ordered_bulk_op() was removed in PyMongo 4.0; pymongo.errors.ConnectionError does not exist and raised AttributeError in the error-handling example itself; $vectorSearch was passed to find(), where it is rejected as an unknown top-level operator, rather than to aggregate() where it must be the first stage; a "proper cleanup" example had a try: whose body was only a comment, which is an IndentationError; and a PostgreSQL-integration example imported documentdb_api, a Python package that does not exist and is not on PyPI. The last one is deleted rather than repaired, since there is nothing to point it at. mongo-shell-quickstart.md: the vector index used the createIndex helper, which rejects the cosmosSearchOptions spec with "Index type 'CosmosSearch' was requested, but the 'cosmosSearch' options were not provided." Use the createIndexes runCommand form, which works, and name the error so anyone who already hit it can find this. vscode-quickstart.md claimed "You must set these when creating the container for authentication to work". That is false and inverts a real risk: omitting the credentials starts the container with the public default_user / Admin100, which authenticates. Say so instead. Also fixes invalid JSON (new Date() inside a json fence) and a "dataabse" typo. Prerequisites were stale in a way that produces confusing failures rather than clear ones: Node.js 14 against a driver requiring >=20.19, and Python 3.7 against PyMongo requiring >=3.9. nodejs-setup.md had 54 lines of empty catalogue -- seven headings whose bodies were numbered lists of topics with no content, promising bulk operations, transactions, testing and deployment guidance that does not exist. Replaced with a working CRUD example and one honest pointer. vscode-extension-guide.md is 268 lines the website already replaces with a redirect to the Quick Start, and it carried a hardcoded password123, a docker image rm that deletes the image it just told you to run, and "created_at": new Date(2024-11-16), which is invalid JSON and, as JavaScript, evaluates to 1997 and yields a 1970 date. Collapsed to a pointer. Deleted aws-setup, azure-setup, gcp-setup, yugabyte-setup and mongodb-migration. All five are referenced nowhere -- absent from navigation.yml and unlinked from any page -- yet remain live indexable URLs. Each is a title and a restated description with no procedure; gcp-setup is one sentence, azure-setup ends on a bare "## Setup" heading with nothing under it. A 15-word page ranking for a real query is worse than a 404. Removing azure-setup also retires the Micrtosoft typo the website was patching at runtime. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f18515db-c52f-4197-aa50-d81359c7c763 Signed-off-by: Guanzhou Song <guanzhou.song@gmail.com>
guanzhousongmicrosoft
approved these changes
Aug 25, 2026
guanzhousongmicrosoft
left a comment
Contributor
There was a problem hiding this comment.
Sample code failures reproduced; orphan stubs confirmed unreferenced. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six reviews (Opus 5, Opus 4.8, GPT-5.6 Sol — two repos each) scored the docs against a written standard derived from Diátaxis, the CloudNativePG layout, the PostgreSQL documentation guide, and failures reproduced against DocumentDB's own published pages.
Docs-repo mean: 20.7/50. All three reviewers described the same shape: a strong reference core (
postgres-api/,api-reference/,documentdb-local/,kubernetes-operator/) attached to a decaying getting-started front door — which is where a new user lands.One reviewer executed the samples against a live gateway instead of reading them.
python-setup.mdfailed six different ways.1.
python-setup.mdwas not runnabledatetime.utcnow()used 43 lines before its import →NameErroron copy-pasteinitialize_ordered_bulk_op()— removed in PyMongo 4.0$vectorSearchpassed tofind()→unknown top level operator: $vectorSearch. It is an aggregation stage and must be first in the pipelinefrom documentdb_api import DocumentDB— no such package, not on PyPI, not in this projectpymongo.errors.ConnectionErrordoesn't exist →AttributeErrorinside the error-handling exampletry:whose body is only a comment →IndentationErrorThe
documentdb_apiblock is deleted rather than repaired — there is nothing real to point it at.2. The vector index could not be created as documented
createIndexrejects thecosmosSearchOptionsspec:Switched to the
createIndexesrunCommandform, which works, and the error string is now named so anyone who already hit it can find this page.3. A security claim that was backwards
vscode-quickstart.mdsaid: "You must set these when creating the container for authentication to work."False, and it inverts a real risk. Omitting
--username/--passwordstarts the container with the built-indefault_user/Admin100— public credentials that authenticate. Verified live. The page now says so.4. Stale prerequisites that fail confusingly
Node.js 14.x or lateragainst a driver requiring>=20.19;Python 3.7+against PyMongo requiring>=3.9.5. 54 lines of empty catalogue
nodejs-setup.mdhad seven headings whose bodies were numbered topic lists with no content — promising bulk operations, transactions, testing and deployment guidance that does not exist. Replaced with a working CRUD example and one honest pointer.6. Deletions
vscode-extension-guide.md— 268 lines the website already replaces with a redirect to the Quick Start, carrying a hardcodedpassword123, adocker image rmthat deletes the image it just told you to run, and"created_at": new Date(2024-11-16)— invalid JSON, and as JavaScript it evaluates2024-11-16to1997, yielding a 1970 date. Collapsed to a pointer.Five orphan stubs —
aws-setup,azure-setup,gcp-setup,yugabyte-setup,mongodb-migration. Verified 0 references: absent fromnavigation.yml, unlinked from every page, yet live indexable URLs. Each is a title plus a restated description with no procedure —gcp-setupis one sentence;azure-setupends on a bare## Setupheading with nothing under it. A 15-word page ranking for a real query is worse than a 404.Removing
azure-setupalso retires theMicrtosofttypo that the website was patching at runtime (articleService.tscarried a.replace(/Micrtosoft/g, 'Microsoft')) — a band-aid over a source typo, now unnecessary.Note on the review process
Two of six reviewers reported a "broken URI" containing
******in this repo. That was the credential-redaction filter maskingmongodb://user:pass@hostin their own transcripts —******appears nowhere in the repo. Verified against raw bytes and discarded; one reviewer caught it independently. Nothing here was changed without confirming it in the actual file.Related
documentdb/documentdb.github.io#161 — the website half: broken certificate path, the false sample-data default, an ARM-breaking mongosh repo URL, and the missing Docker lifecycle.