microsoft / microsoft/vscode-documentdb
Revisit: confirm parseShellBSON (Loose) backward compatibility with EJSON.parse for projection and sort
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 31
- Forks
- 22
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 21
Description
Context
In ClustersClient.runFindQuery / streamFindQuery and ClusterSession.getCurrentFindQueryParamsForExecution, projection and sort strings are now parsed with @mongodb-js/shell-bson-parser in ParseMode.Loose, replacing EJSON.parse.
The loose parser is a superset of strict EJSON and accepts mongosh style input such as unquoted keys and ObjectId(...). Telemetry already counts parse failures via QueryError('INVALID_PROJECTION' | 'INVALID_SORT'), so post-release regressions are observable.
This issue tracks a focused compatibility pass to confirm that strict EJSON inputs that previously parsed still produce the same runtime values.
Suggested verification
- Projection
{ "createdAt": { "$date": "2024-01-01T00:00:00Z" } }produces an equivalentDate. - Sort
{ "_id": -1 }is unchanged. - Nested extended JSON:
{ "$gt": { "$numberLong": "9007199254740992" } }. - Empty
{}strings remain short-circuited.
Definition of done
- A small fixture-driven unit test asserts equivalence between the old
EJSON.parseoutput and the newparseShellBSONoutput for a representative set of strict EJSON inputs.
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 with ClustersClient.runFindQuery, streamFindQuery, and ClusterSession.getCurrentFindQueryParamsForExecution to trace projection and sort parsing. Add a fixture-driven unit test comparing EJSON.parse with parseShellBSON in Loose mode for the listed strict EJSON cases, including empty strings. Done means equivalent runtime values are asserted for representative projection, sort, date, and numberLong inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, typescript
- Domain
- databases, testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100