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

Method appendMetadata

src/mongo_client.ts:495–505  ·  view source on GitHub ↗

* Append metadata to the client metadata after instantiation. * @param driverInfo - Information about the application or library.

(driverInfo: DriverInfo)

Source from the content-addressed store, hash-verified

493 * @param driverInfo - Information about the application or library.
494 */
495 appendMetadata(driverInfo: DriverInfo) {
496 const isDuplicateDriverInfo = this.driverInfoList.some(info =>
497 isDriverInfoEqual(info, driverInfo)
498 );
499 if (isDuplicateDriverInfo) return;
500
501 this.driverInfoList.push(driverInfo);
502 this.options.metadata = makeClientMetadata(this.driverInfoList, this.options)
503 .then(undefined, squashError)
504 .then(result => result ?? ({} as ClientMetadata)); // ensure Promise<Document>
505 }
506
507 /** @internal */
508 private checkForNonGenuineHosts() {

Callers 3

constructorMethod · 0.95
operations.tsFile · 0.80

Calls 3

isDriverInfoEqualFunction · 0.90
makeClientMetadataFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected