Is there way to check correctness of mongoDB connection?
问题 In my spring boot application i use spring-boot-starter-data-mongodb:2.1.3 to get coonection for MongoDB. I have some properties file to config mongoDB: spring.data.mongodb.host=localhost spring.data.mongodb.port=27017 spring.data.mongodb.database=database If i set incorrect host name ( spring.data.mongodb.host=incorrect host ) or port my application starts successfully. But i want that application to fail as same as when i set host name with wrong format ( spring.data.mongodb.host=hxxt:/