@pi-r/mongodb 0.6.2 → 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 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.2",
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",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/anpham6/pi-r.git",
12
+ "url": "git+https://github.com/anpham6/pi-r.git",
13
13
  "directory": "src/db/mongodb"
14
14
  },
15
15
  "keywords": [
@@ -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.2",
25
- "@e-mc/request": "^0.8.2",
26
- "@e-mc/types": "^0.8.2",
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
  }
package/types/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export interface MongoDBDataSource extends DbDataSource<Filter<Document> | Mongo
10
10
  updateType?: 0 | 1 | 2 | 3;
11
11
  }
12
12
 
13
- export interface MongoDBCredential extends ServerAuth, Pick<MongoClientOptions, "auth" | "authMechanism" | "authSource" | "tlsCAFile" | "tlsCertificateFile" | "tlsCertificateKeyFile" | "tlsCertificateKeyFilePassword" | "sslCA" | "sslKey" | "sslCert"> {}
13
+ export interface MongoDBCredential extends ServerAuth, Pick<MongoClientOptions, "auth" | "authMechanism" | "authSource" | "tlsCertificateKeyFile" | "tlsCertificateKeyFilePassword" | "tlsCAFile" | "tlsCRLFile" | "tlsAllowInvalidHostnames" | "tlsAllowInvalidCertificates" | "tlsInsecure"> {}
14
14
 
15
15
  export interface MongoDBSortValue {
16
16
  value?: Sort;