We use a mogodb cluster and therefore our URI is starting with mongodb+srv://.
This unfortunately means, that we cannot use the username and password properties, but have to URL encode everything manually. On top we have the database credentials stored in a central place, which we then have to copy/paste into the URL to use.
Is there a way to add functionality to support mongodb+srv:// together with credentials being separate?
Eg. a property for the prefix?
Comment From: snicoll
The doc states:
You can declare one or more MongoClientSettingsBuilderCustomizer beans to fine-tune the MongoClientSettings configuration. Each will be called in order with the MongoClientSettings.Builder that is used to build the MongoClientSettings.
Going forward, please ask questions on StackOverflow, as mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
Comment From: huehnerlady
we prefer to use GitHub issues only for bugs and enhancements.
For me that was meant as an enhancement.
Currently you cannot use the properties with the mongodb+srv (docs here). So my enhancement request was to enable that by eg. adding a prefix property.
Of course you can do several things manually, but this is a mongodb standard so my hope was that it would be good to support that prefix out of the box.
Our workaround is to only use the uri parameter, which unfortunately then means we have to duplicate secrets. So my hope was that this could be an enhancement to the builder of the mongodb URI using spring boot
Comment From: huehnerlady
@snicoll for me a valid answer would be that this is nothing you want to support, but I have to disagree with the declaration of it being a question for help.
Comment From: snicoll
For me that was meant as an enhancement.
Sorry, I didn't read it that way, see:
Is there a way to add functionality to support mongodb+srv:// together with credentials being separate?
This looks like a question, and I believe that I've tried to answer it. If you search the issue tracker, you'll also see this has been raised before, #17215.