Checkout the new MongoDbConfiguration Provider for ASP5. https://www.nuget.org/packages/MongoDb.Asp.ConfigurationProvider/ with support for blank and null keys.
Install-Package MongoDb.Asp.ConfigurationProvider
Usage: Use the single line config to load the configuration:
builder.AddMongoDbConfiguration(“mongodb://localhost”,”ConfigDatabase”,”SettingsCollection”,”SettingType”, “SettingValue”);
A brief blog post on implementation and open source GIT Path shall soon follow.