I am using mongodb native driver:
"mongodb": "^2.2.33",
And trying to retrieve the name of the database from uri...
I tried something like this:
const Mongodb = require('mongodb')
let mongoUrl = new Mongodb.create(opts.mongo.url);
console.log(mongoUrl.databaseName);
But not working, any solution for this?