@xnestjs/mongodb 1.6.2 → 1.6.3
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.
|
@@ -102,14 +102,14 @@ let MongodbCoreModule = MongodbCoreModule_1 = class MongodbCoreModule {
|
|
|
102
102
|
}
|
|
103
103
|
onApplicationBootstrap() {
|
|
104
104
|
const options = this.connectionOptions;
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
105
|
+
if (options.lazyConnect)
|
|
106
|
+
return;
|
|
107
|
+
this.logger?.log(`Connecting to MongoDB [${options.database}] at ${colors.blue(options.url)}`);
|
|
108
|
+
common_1.Logger.flush();
|
|
109
|
+
return this.client.connect().catch(e => {
|
|
110
|
+
this.logger?.error('MongoDB connection failed: ' + e.message);
|
|
111
|
+
throw e;
|
|
112
|
+
});
|
|
113
113
|
}
|
|
114
114
|
onApplicationShutdown() {
|
|
115
115
|
return this.client.close(true);
|
|
@@ -99,14 +99,14 @@ let MongodbCoreModule = MongodbCoreModule_1 = class MongodbCoreModule {
|
|
|
99
99
|
}
|
|
100
100
|
onApplicationBootstrap() {
|
|
101
101
|
const options = this.connectionOptions;
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
102
|
+
if (options.lazyConnect)
|
|
103
|
+
return;
|
|
104
|
+
this.logger?.log(`Connecting to MongoDB [${options.database}] at ${colors.blue(options.url)}`);
|
|
105
|
+
Logger.flush();
|
|
106
|
+
return this.client.connect().catch(e => {
|
|
107
|
+
this.logger?.error('MongoDB connection failed: ' + e.message);
|
|
108
|
+
throw e;
|
|
109
|
+
});
|
|
110
110
|
}
|
|
111
111
|
onApplicationShutdown() {
|
|
112
112
|
return this.client.close(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xnestjs/mongodb",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "NestJS extension library for MongoDb",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
15
15
|
"@nestjs/core": "^10.0.0 || ^11.0.0",
|
|
16
|
-
"mongodb": "^6.14.
|
|
16
|
+
"mongodb": "^6.14.2"
|
|
17
17
|
},
|
|
18
18
|
"type": "module",
|
|
19
19
|
"exports": {
|