Skip to content

Commit 4268aec

Browse files
authored
chore(deps): bump driver to 4.2.1 COMPASS-5340 (#1168)
* chore(deps): bump driver to 4.2.1 COMPASS-5340 Bump the Node.js driver to 4.2.1 and its bson package to 4.6.0. * fixup: adjust types to account for webpack TS problem
1 parent 3850dc4 commit 4268aec

File tree

12 files changed

+65
-106
lines changed

12 files changed

+65
-106
lines changed

package-lock.json

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"karma-typescript": "^5.5.1",
123123
"lerna": "^4.0.0",
124124
"mocha": "^7.1.2",
125-
"mongodb": "^4.1.4",
125+
"mongodb": "^4.2.1",
126126
"mongodb-download-url": "^1.1.2",
127127
"mongodb-js-precommit": "^2.0.0",
128128
"nock": "^13.0.11",

packages/node-runtime-worker-thread/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/node-runtime-worker-thread/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@mongosh/service-provider-core": "0.0.0-dev.0",
3434
"@mongosh/service-provider-server": "0.0.0-dev.0",
3535
"@mongosh/types": "0.0.0-dev.0",
36-
"bson": "^4.5.4",
36+
"bson": "^4.6.0",
3737
"mocha": "^7.1.2",
3838
"postmsg-rpc": "^2.4.0",
3939
"terser-webpack-plugin": "^4.2.3",

packages/node-runtime-worker-thread/src/worker-runtime.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,21 @@ const workerRuntime: WorkerRuntime = {
8585
driverOptions: MongoClientOptions = {},
8686
cliOptions: { nodb?: boolean } = {}
8787
) {
88-
provider = await CompassServiceProvider.connect(
88+
// XXX The types here work out fine, and tsc accepts this code
89+
// without 'as any'. However, since a change to the driver's
90+
// .find() method signature (https://github.com/mongodb/node-mongodb-native/commit/307d623ea597c5d89c548b6731bd692fec7a8047)
91+
// the webpack integration build fails with:
92+
// [tsl] ERROR in /home/addaleax/src/mongosh/packages/node-runtime-worker-thread/src/worker-runtime.ts(88,5)
93+
// TS2589: Type instantiation is excessively deep and possibly infinite.
94+
// I could not figure out why exactly that was the case, so 'as any'
95+
// will have to do for now.
96+
provider = await (CompassServiceProvider as any).connect(
8997
uri,
9098
driverOptions,
9199
cliOptions,
92100
messageBus
93101
);
94-
runtime = new ElectronRuntime(provider, messageBus);
102+
runtime = new ElectronRuntime(provider as ServiceProvider, messageBus);
95103
runtime.setEvaluationListener(evaluationListener);
96104
},
97105

packages/service-provider-core/package-lock.json

Lines changed: 8 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/service-provider-core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"dependencies": {
3333
"@mongosh/errors": "0.0.0-dev.0",
3434
"@mongosh/i18n": "0.0.0-dev.0",
35-
"bson": "^4.5.4",
36-
"mongodb": "^4.1.4",
35+
"bson": "^4.6.0",
36+
"mongodb": "^4.2.1",
3737
"mongodb-build-info": "^1.2.0",
3838
"mongodb-connection-string-url": "^2.2.0"
3939
},

packages/service-provider-server/package-lock.json

Lines changed: 11 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/service-provider-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@mongosh/types": "0.0.0-dev.0",
4444
"@types/sinon-chai": "^3.2.3",
4545
"aws4": "^1.11.0",
46-
"mongodb": "^4.1.4",
46+
"mongodb": "^4.2.1",
4747
"mongodb-connection-string-url": "^2.2.0",
4848
"saslprep": "mongodb-js/saslprep#v1.0.4"
4949
},

packages/shell-api/src/change-stream-cursor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default class ChangeStreamCursor extends ShellApiWithMongoClass {
5656

5757
@returnsPromise
5858
@deprecated
59-
async hasNext(): Promise<void> {
59+
async hasNext(): Promise<boolean> {
6060
await this._instanceState.printWarning(
6161
'If there are no documents in the batch, hasNext will block. Use tryNext if you want to check if there ' +
6262
'are any documents without waiting.'

0 commit comments

Comments
 (0)