@mikro-orm/mongodb 6.3.14-dev.56 → 6.3.14-dev.57
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/MongoConnection.d.ts +4 -2
- package/MongoConnection.js +3 -1
- package/package.json +2 -2
package/MongoConnection.d.ts
CHANGED
|
@@ -8,8 +8,10 @@ export declare class MongoConnection extends Connection {
|
|
|
8
8
|
close(force?: boolean): Promise<void>;
|
|
9
9
|
isConnected(): Promise<boolean>;
|
|
10
10
|
checkConnection(): Promise<{
|
|
11
|
-
ok:
|
|
12
|
-
|
|
11
|
+
ok: true;
|
|
12
|
+
} | {
|
|
13
|
+
ok: false;
|
|
14
|
+
reason: string;
|
|
13
15
|
error?: Error;
|
|
14
16
|
}>;
|
|
15
17
|
getClient(): MongoClient;
|
package/MongoConnection.js
CHANGED
|
@@ -48,7 +48,9 @@ class MongoConnection extends core_1.Connection {
|
|
|
48
48
|
async checkConnection() {
|
|
49
49
|
try {
|
|
50
50
|
const res = await this.db?.command({ ping: 1 });
|
|
51
|
-
return
|
|
51
|
+
return res.ok
|
|
52
|
+
? { ok: true }
|
|
53
|
+
: { ok: false, reason: 'Ping reply does not feature "ok" property, or it evaluates to "false"' };
|
|
52
54
|
}
|
|
53
55
|
catch (error) {
|
|
54
56
|
return { ok: false, reason: error.message, error };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/mongodb",
|
|
3
|
-
"version": "6.3.14-dev.
|
|
3
|
+
"version": "6.3.14-dev.57",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
"@mikro-orm/core": "^6.3.13"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@mikro-orm/core": "6.3.14-dev.
|
|
68
|
+
"@mikro-orm/core": "6.3.14-dev.57"
|
|
69
69
|
}
|
|
70
70
|
}
|