@tomsd/mongodbclient 2.7.1 → 2.7.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.
|
@@ -31,7 +31,7 @@ export declare class MClient {
|
|
|
31
31
|
stats(): Promise<unknown>;
|
|
32
32
|
count(condition?: any): Promise<number>;
|
|
33
33
|
insertMany(items: any[]): Promise<unknown>;
|
|
34
|
-
dbStats(): Promise<
|
|
34
|
+
dbStats(): Promise<any>;
|
|
35
35
|
getCollections(): Promise<any>;
|
|
36
36
|
}
|
|
37
37
|
export default MClient;
|
|
@@ -191,20 +191,17 @@ class MClient {
|
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
dbStats() {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
reject(e);
|
|
206
|
-
});
|
|
207
|
-
}, reject);
|
|
194
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
195
|
+
const connection = yield this.getConnected();
|
|
196
|
+
try {
|
|
197
|
+
return yield connection.db.stats();
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
throw e;
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
connection.client.close();
|
|
204
|
+
}
|
|
208
205
|
});
|
|
209
206
|
}
|
|
210
207
|
getCollections() {
|
|
@@ -31,7 +31,7 @@ export declare class MClient {
|
|
|
31
31
|
stats(): Promise<unknown>;
|
|
32
32
|
count(condition?: any): Promise<number>;
|
|
33
33
|
insertMany(items: any[]): Promise<unknown>;
|
|
34
|
-
dbStats(): Promise<
|
|
34
|
+
dbStats(): Promise<any>;
|
|
35
35
|
getCollections(): Promise<any>;
|
|
36
36
|
}
|
|
37
37
|
export default MClient;
|
|
@@ -187,20 +187,17 @@ export class MClient {
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
dbStats() {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
reject(e);
|
|
202
|
-
});
|
|
203
|
-
}, reject);
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
const connection = yield this.getConnected();
|
|
192
|
+
try {
|
|
193
|
+
return yield connection.db.stats();
|
|
194
|
+
}
|
|
195
|
+
catch (e) {
|
|
196
|
+
throw e;
|
|
197
|
+
}
|
|
198
|
+
finally {
|
|
199
|
+
connection.client.close();
|
|
200
|
+
}
|
|
204
201
|
});
|
|
205
202
|
}
|
|
206
203
|
getCollections() {
|