microsoft / microsoft/vscode-documentdb
Revisit: getMongoClient() JSDoc is misleading; only used by main thread scanCollectionSchema
Nobody has claimed this yet.
- 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
- Update the JSDoc to reflect the real caller: schema scan from the extension host.
- Consider whether exposing the raw
MongoClientis necessary at all, or whether a narrower API onClustersClient(for examplegetCollection(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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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