Skip to content

Commit ec0175f

Browse files
committed
feat(NODE-4509): send 1 with hello commands
1 parent b4e63fb commit ec0175f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/cmap/connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export function prepareHandshakeDocument(
231231
const { serverApi } = authContext.connection;
232232

233233
const handshakeDoc: HandshakeDocument = {
234-
[serverApi?.version ? 'hello' : LEGACY_HELLO_COMMAND]: true,
234+
[serverApi?.version ? 'hello' : LEGACY_HELLO_COMMAND]: 1,
235235
helloOk: true,
236236
client: options.metadata || makeClientMetadata(options),
237237
compression: compressors

src/sdam/monitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function checkServer(monitor: Monitor, callback: Callback<Document | null>) {
238238
const isAwaitable = topologyVersion != null;
239239

240240
const cmd = {
241-
[serverApi?.version || helloOk ? 'hello' : LEGACY_HELLO_COMMAND]: true,
241+
[serverApi?.version || helloOk ? 'hello' : LEGACY_HELLO_COMMAND]: 1,
242242
...(isAwaitable && topologyVersion
243243
? { maxAwaitTimeMS, topologyVersion: makeTopologyVersion(topologyVersion) }
244244
: {})

test/integration/mongodb-handshake/promise_handshake.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Handshake', function () {
2828
// Execute legacy hello command
2929
client
3030
.db(configuration.db)
31-
.command({ [LEGACY_HELLO_COMMAND]: true })
31+
.command({ [LEGACY_HELLO_COMMAND]: 1 })
3232
.then(function (result) {
3333
test.ok(result !== null);
3434

0 commit comments

Comments
 (0)