@travetto/model-mongo 7.0.0 → 7.0.2

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/README.md CHANGED
@@ -148,7 +148,8 @@ export class MongoModelConfig {
148
148
  }
149
149
 
150
150
  if (!Runtime.production) {
151
- options.waitQueueTimeoutMS ??= TimeUtil.asMillis(1, 'd'); // Wait a day in dev mode
151
+ options.waitQueueTimeoutMS = 0;
152
+ options.serverSelectionTimeoutMS = TimeUtil.asMillis(1, 's');
152
153
  }
153
154
  }
154
155
 
@@ -159,7 +160,7 @@ export class MongoModelConfig {
159
160
  const hosts = this.hosts!
160
161
  .map(host => (this.srvRecord || host.includes(':')) ? host : `${host}:${this.port ?? 27017}`)
161
162
  .join(',');
162
- const optionString = Object.entries(this.options).map(([key, value]) => `${key}=${value}`).join('&');
163
+ const optionString = new URLSearchParams(Object.entries(this.options)).toString();
163
164
  let creds = '';
164
165
  if (this.username) {
165
166
  creds = `${[this.username, this.password].filter(part => !!part).join(':')}@`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-mongo",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "type": "module",
5
5
  "description": "Mongo backing for the travetto model module.",
6
6
  "keywords": [
@@ -26,10 +26,10 @@
26
26
  "directory": "module/model-mongo"
27
27
  },
28
28
  "dependencies": {
29
- "@travetto/cli": "^7.0.0",
30
- "@travetto/config": "^7.0.0",
31
- "@travetto/model": "^7.0.0",
32
- "@travetto/model-query": "^7.0.0",
29
+ "@travetto/cli": "^7.0.2",
30
+ "@travetto/config": "^7.0.2",
31
+ "@travetto/model": "^7.0.2",
32
+ "@travetto/model-query": "^7.0.2",
33
33
  "mongodb": "^7.0.0"
34
34
  },
35
35
  "travetto": {
package/src/config.ts CHANGED
@@ -107,7 +107,8 @@ export class MongoModelConfig {
107
107
  }
108
108
 
109
109
  if (!Runtime.production) {
110
- options.waitQueueTimeoutMS ??= TimeUtil.asMillis(1, 'd'); // Wait a day in dev mode
110
+ options.waitQueueTimeoutMS = 0;
111
+ options.serverSelectionTimeoutMS = TimeUtil.asMillis(1, 's');
111
112
  }
112
113
  }
113
114
 
@@ -118,7 +119,7 @@ export class MongoModelConfig {
118
119
  const hosts = this.hosts!
119
120
  .map(host => (this.srvRecord || host.includes(':')) ? host : `${host}:${this.port ?? 27017}`)
120
121
  .join(',');
121
- const optionString = Object.entries(this.options).map(([key, value]) => `${key}=${value}`).join('&');
122
+ const optionString = new URLSearchParams(Object.entries(this.options)).toString();
122
123
  let creds = '';
123
124
  if (this.username) {
124
125
  creds = `${[this.username, this.password].filter(part => !!part).join(':')}@`;