Skip to content

Commit b362a66

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

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
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

test/unit/sdam/monitor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ describe('monitoring', function () {
237237
const doc = request.document;
238238
docs.push(doc);
239239
if (docs.length === 2) {
240-
expect(docs[0]).to.have.property(LEGACY_HELLO_COMMAND, true);
240+
expect(docs[0]).to.have.property(LEGACY_HELLO_COMMAND, 1);
241241
expect(docs[0]).to.have.property('helloOk', true);
242242
expect(docs[1]).to.have.property('hello', true);
243243
done();

0 commit comments

Comments
 (0)