Mongodb uses use to create the library, but report the permission problem, how to solve it

this is the properties of my springboot configuration mongodb

spring.data.mongodb.uri=mongodb://username:password-sharp@yoururl:port/xfind?replicaSet=mgset-5652935,dds-bp14d30374d4cbb42723-pub.mongodb.rds.aliyuncs.com:3717
com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName="root", source="xfind", password=<hidden>, mechanismProperties={}}
Mar.06,2021

the connection string is not written correctly. Reference document for correct format: https://docs.mongodb.com/manu.
for example:

mongodb://db1.example.net:27017,db2.example.net:2500/?replicaSet=test

change to the following configuration

-sharp mongodb
spring.data.mongodb.host=your-mongodb-url
spring.data.mongodb.port=your-mongodb-port
spring.data.mongodb.username=your-mongodb-username
spring.data.mongodb.password=your-mongodb-password
spring.data.mongodb.database=your-mongodb-database
spring.data.mongodb.authentication-database=admin
Menu