microsoft / microsoft/vscode-documentdb

Revisit: getMongoClient() JSDoc is misleading; only used by main thread scanCollectionSchema

Open Beginner friendly
#643 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation needs-triage P3
Dominant language
TypeScript
Stars
31
Forks
22
Avg merge
2d 20h
Merged PRs (30d)
21

Description

Context

ClustersClient.getMongoClient() has a JSDoc that says:

Used by the query playground evaluator to create a @mongosh ServiceProvider that reuses the existing, authenticated connection.

In practice the playground worker has its own MongoClient (different Node worker_thread, separate V8 isolate). The only caller of getMongoClient() is src/commands/playground/scanCollectionSchema.ts which runs in the extension host (main thread). The JSDoc is misleading.

Suggested solutions

  1. Update the JSDoc to reflect the real caller: schema scan from the extension host.
  2. Consider whether exposing the raw MongoClient is necessary at all, or whether a narrower API on ClustersClient (for example getCollection(db, coll)) would be safer to expose.

Definition of done

  • JSDoc accurately reflects the caller.
  • Optional: scope of the public API surface is reduced.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/documentdb/ClustersClient.ts and inspect the getMongoClient() JSDoc, then read its only named caller, src/commands/playground/scanCollectionSchema.ts. Update the documentation to describe the extension-host schema scan accurately and assess whether the suggested narrower API is needed; done means the JSDoc matches actual usage and any API-scope decision is recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.