@discue/mongodb-resource-client
Advanced tools
Comparing version 0.36.0 to 0.37.0
@@ -9,3 +9,3 @@ export = exports; | ||
constructor({ client, databaseName, collectionName }?: ConstructorOptions); | ||
_mongoDbClient: import("mongodb").MongoClient; | ||
/** @private */ private _mongoDbClient; | ||
/** @private */ private _databaseName; | ||
@@ -12,0 +12,0 @@ /** @private */ private _collectionName; |
@@ -59,3 +59,3 @@ 'use strict' | ||
if (client) { | ||
this._mongoDbClient = client | ||
/** @private */ this._mongoDbClient = client | ||
} else { | ||
@@ -62,0 +62,0 @@ throw new Error('Configuration Error. `client` needs to be set.') |
@@ -441,8 +441,11 @@ 'use strict' | ||
*/ | ||
close() { | ||
return Promise.all([ | ||
this._hostStorage.close(), | ||
super.close() | ||
]) | ||
async close() { | ||
await this._hostStorage.close() | ||
// check first whether topology is still set. Very likely we are using | ||
// the same MongoClient and thus don't need to call `close` | ||
// of the super class | ||
if (this._mongoDbClient.topology) { | ||
await super.close() | ||
} | ||
} | ||
} |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.36.0", | ||
"version": "0.37.0", | ||
"description": "Simple wrapper around mongodb client allowing easier managing of resources", | ||
@@ -8,0 +8,0 @@ "main": "lib/index", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137648
3495