Skip to content

Fix two samples broken by the previous round, and a contradictory claim - #72

Merged
guanzhousongmicrosoft merged 1 commit into
documentdb:mainfrom
GuanzhouSong:users/guanzhousong/rereview-fixes
Aug 25, 2026
Merged

Fix two samples broken by the previous round, and a contradictory claim#72
guanzhousongmicrosoft merged 1 commit into
documentdb:mainfrom
GuanzhouSong:users/guanzhousong/rereview-fixes

Conversation

@GuanzhouSong

@GuanzhouSong GuanzhouSong commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

A second review pass — same rubric, same three models — was run after the previous fixes merged. It executed the samples against a live gateway instead of reading them, and two of the three broken commands it found had been introduced by that previous round. That is the re-review doing its job.

1. The replacement Node.js example did not run

Reproduced independently by two models:

FAIL "Creating collections" block as pasted:  ReferenceError: db is not defined
FAIL "Document operations" block as pasted:   ReferenceError: db is not defined

const db was declared inside a connect() that is never called, so the following blocks referenced it out of scope. They also used top-level await outside an async function — a second paste failure.

Replaced with one self-contained main() that connects, operates and closes, plus a sentence explaining why these statements cannot be pasted at the top level.

2. The $vectorSearch fix was incomplete

Moving it from find() to aggregate() was correct but not sufficient — the stage needs a vector index and the page never created one:

FAIL $vectorSearch (as documented): OperationFailure: Similarity index was not found
     for a vector similarity search query.  {'ok': 0.0, 'code': 2, 'codeName': 'BadValue'}

The reviewer confirmed the stage works once an index exists. Added the createIndexes call — matching the form the mongo-shell quick start already uses — and the dimensions caveat.

3. postgres-api/index.md contradicted itself

Line 8 said DocumentDB "consists of three PostgreSQL extensions". Line 56 of the same page correctly describes pg_documentdb_gw as a standalone process that can optionally run as a background worker via a separate pg_documentdb_gw_host extension. It is two extensions and a gateway.

Verification

The two sample failures were reproduced by both Opus 5 and GPT-5.6 Sol independently, each executing the code against a live documentdb-local container rather than reading it.

Related

documentdb/documentdb.github.io#162 — the website-owned copy of the Node.js prerequisite floor.

A second review pass, run after the previous fixes merged, executed the
samples against a live gateway. Two of the three broken commands it found
had been introduced by that round -- which is the point of re-reviewing.

nodejs-setup.md: the replacement CRUD example did not run. `const db` was
declared inside a connect() that was never called, so the following blocks
referenced it out of scope and failed with "ReferenceError: db is not
defined"; they also used top-level await outside an async function. Two
independent reviewers reproduced both. Replaced with one self-contained
main() that connects, operates and closes, and a sentence saying why the
statements cannot be pasted at the top level.

python-setup.md: moving $vectorSearch from find() to aggregate() was
correct but incomplete. The stage needs a vector index, and the page never
created one, so the documented query still failed with "Similarity index
was not found for a vector similarity search query". Added the
createIndexes call, matching the form the mongo-shell quick start uses,
plus the dimensions caveat.

postgres-api/index.md contradicted itself: the opening said DocumentDB
"consists of three PostgreSQL extensions", while the pg_documentdb_gw
section correctly describes a standalone process that can optionally run
as a background worker via a separate pg_documentdb_gw_host extension. Two
extensions and a gateway.

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
guanzhousongmicrosoft merged commit ca66286 into documentdb:main Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants