spring.data.mongodb.host replica set code example
Example: spring.data.mongodb.host replica set
must get rid of the following property
spring.data.mongodb.host=server1
spring.data.mongodb.port=27017
spring.data.mongodb.authentication-database=system
spring.data.mongodb.database=database
then use
spring.data.mongodb.uri=mongodb://username:password@server1:port,server2:port/database