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

Method close

src/mongo_client.ts:743–755  ·  view source on GitHub ↗

* Cleans up resources managed by the MongoClient. * * The close method clears and closes all resources whose lifetimes are managed by the MongoClient. * Please refer to the `MongoClient` class documentation for a high level overview of the client's key features and responsibilities. *

(_force = false)

Source from the content-addressed store, hash-verified

741 * @param _force - currently an unused flag that has no effect. Defaults to `false`.
742 */
743 async close(_force = false): Promise<void> {
744 if (this.closeLock) {
745 return await this.closeLock;
746 }
747
748 try {
749 this.closeLock = this._close();
750 await this.closeLock;
751 } finally {
752 // release
753 this.closeLock = undefined;
754 }
755 }
756
757 /* @internal */
758 private async _close(): Promise<void> {

Callers 11

testConfigBeforeHookFunction · 0.95
makeConnectionTestFunction · 0.95
testConnectionFunction · 0.95
runFunction · 0.95
testAggregateFunction · 0.95
testFindOneAndUpdateFunction · 0.95
testBulkWriteFunction · 0.95
executeSDAMTestFunction · 0.95
[Symbol.asyncDispose]Method · 0.95
topologyConnectMethod · 0.45
_closeMethod · 0.45

Calls 1

_closeMethod · 0.95

Tested by 7

makeConnectionTestFunction · 0.76
testConnectionFunction · 0.76
runFunction · 0.76
testAggregateFunction · 0.76
testFindOneAndUpdateFunction · 0.76
testBulkWriteFunction · 0.76
executeSDAMTestFunction · 0.76