@pi-r/mongodb 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/index.js +3 -1
- package/package.json +4 -4
package/client/index.js
CHANGED
|
@@ -47,9 +47,10 @@ class MongoDBPool extends DbPool {
|
|
|
47
47
|
}
|
|
48
48
|
const POOL_STATE = {};
|
|
49
49
|
const POOL_UNUSED = ['maxPoolSize', 'minPoolSize', 'connectTimeoutMS', 'socketTimeoutMS', 'maxConnecting', 'maxIdleTimeMS', 'waitQueueTimeoutMS', 'serverSelectionTimeoutMS', 'heartbeatFrequencyMS', 'minHeartbeatFrequencyMS', 'compressors', 'zlibCompressionLevel', 'srvMaxHosts'];
|
|
50
|
+
const POOL_ACTIVE = new WeakSet();
|
|
50
51
|
function removePoolProperties(credential) {
|
|
51
52
|
const options = credential.options;
|
|
52
|
-
if (options && !credential.uuidKey) {
|
|
53
|
+
if (options && !credential.uuidKey && POOL_ACTIVE.has(credential)) {
|
|
53
54
|
let result;
|
|
54
55
|
for (let i = 0, length = POOL_UNUSED.length; i < length; ++i) {
|
|
55
56
|
const attr = POOL_UNUSED[i];
|
|
@@ -260,6 +261,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
260
261
|
try {
|
|
261
262
|
client = await pool.getConnection();
|
|
262
263
|
pool.connected = true;
|
|
264
|
+
POOL_ACTIVE.add(credential);
|
|
263
265
|
}
|
|
264
266
|
catch {
|
|
265
267
|
if (pool.closeable) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/mongodb",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "MongoDB client driver for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"types": "client/index.d.ts",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@e-mc/db": "^0.8.
|
|
25
|
-
"@e-mc/request": "^0.8.
|
|
26
|
-
"@e-mc/types": "^0.8.
|
|
24
|
+
"@e-mc/db": "^0.8.4",
|
|
25
|
+
"@e-mc/request": "^0.8.4",
|
|
26
|
+
"@e-mc/types": "^0.8.4",
|
|
27
27
|
"mongodb": "^6.3.0"
|
|
28
28
|
}
|
|
29
29
|
}
|