xet7
May 20, 2024, 12:21pm
1
Hi,
at Slack, someone asked:
how can i check which mongodb driver version is my Meteor app using?
So here is how to show versions of MongoDB, Node.js etc. It is shown in WeKan Open Source kanban https://wekan.github.io right to username / Admin Panel / Version.
Serverside:
const { version, storageEngine } = Promise.await(
mongo.db.command({ serverStatus: 1 }),
);
mongoVersion = version;
mongoStorageEngine = storageEngine.name;
mongoOplogEnabled = oplogEnabled;
} catch (e) {
try {
const { mongo } = MongoInternals.defaultRemoteCollectionDriver();
const { version } = Promise.await(
mongo.db.command({ buildinfo: 1 }),
);
mongoVersion = version;
mongoStorageEngine = 'unknown';
} catch (e) {
mongoVersion = 'unknown';
mongoStorageEngine = 'unknown';
}
}
statistics.mongo = {
mongoVersion,
Client template:
Client Javascript:
Meteor.call('getStatistics', (error, ret) => {
if (!error && ret) {
this.info.set(ret);
}
});
},
statistics() {
return this.info.get();
},
4 Likes