MCPcopy
hub / github.com/mongodb/node-mongodb-native / lastHello

Method lastHello

src/sdam/topology.ts:773–782  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

771 // to do feature support detection. This should be done any other way, but for
772 // now we will just return the first hello seen, which should suffice.
773 lastHello(): Document {
774 const serverDescriptions = Array.from(this.description.servers.values());
775 if (serverDescriptions.length === 0) return {};
776 const sd = serverDescriptions.filter(
777 (sd: ServerDescription) => sd.type !== ServerType.Unknown
778 )[0];
779
780 const result = sd || { maxWireVersion: this.description.commonWireVersion };
781 return result;
782 }
783
784 get commonWireVersion(): number {
785 return this.description.commonWireVersion;

Callers 2

maxWireVersionFunction · 0.80
constructorFunction · 0.80

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected