Browse Source

Try 2 to fix missing variable in WeKan fails to get MongoDB server version.

Thanks to simon816 and xet7 !

Fixes #4596
Lauri Ojansivu 3 years ago
parent
commit
37f9de8b9b
1 changed files with 5 additions and 8 deletions
  1. 5 8
      server/statistics.js

+ 5 - 8
server/statistics.js

@@ -86,14 +86,11 @@ if (Meteor.isServer) {
           mongoOplogEnabled = oplogEnabled;
         } catch (e) {
           try {
-            if (mongo === undefined) {
-              mongoVersion = 'unknown';
-            } else {
-              const { version } = Promise.await(
-                mongo.db.command({ buildinfo: 1 }),
-              );
-              mongoVersion = version;
-            }
+            const { mongo } = MongoInternals.defaultRemoteCollectionDriver();
+            const { version } = Promise.await(
+              mongo.db.command({ buildinfo: 1 }),
+            );
+            mongoVersion = version;
             mongoStorageEngine = 'unknown';
           } catch (e) {
             mongoVersion = 'unknown';