Mongo Build Info

Hello!

Can I get Mongo DB version from javascript?

Thanks

1 Like

Thank you! I have studied the code and based on it came up to the solution:

const { db } = MongoInternals.defaultRemoteCollectionDriver().mongo;

db.admin().serverInfo((err, res) => {
  if (!err) console.log(res?.version);
});