A small library to parse mongo url strings to extract the database name.
Ever needed to manually run through a connection string provided by MongoDb Atlas to extract the db name? Then this library is for you.
using MongoUrlParser;
...
var databaseConnectionString = "mongodb://user:password@host:port/database-name?otheroptions"; // any mongodb connection string
var (dbUrl, dbName) = Parser.Parse(databaseConnectionString);
// dbUrl: mongodb://user:password@host:port?otheroptions
// dbName: database-name