草庐IT

MongoClientFactoryBean

全部标签

Spring Mongodb : How to configurer mongoDB with MongoClientFactoryBean

在Spring中配置MongoDB时,引用sais:像这样注册MongoDB:@ConfigurationpublicclassAppConfig{/**UsethestandardMongodriverAPItocreateacom.mongodb.Mongoinstance.*/public@BeanMongomongo()throwsUnknownHostException{returnnewMongo("localhost");}}pollutesthecodewiththeUnknownHostExceptioncheckedexception.Theuseofthechec

Spring Mongodb : How to configurer mongoDB with MongoClientFactoryBean

在Spring中配置MongoDB时,引用sais:像这样注册MongoDB:@ConfigurationpublicclassAppConfig{/**UsethestandardMongodriverAPItocreateacom.mongodb.Mongoinstance.*/public@BeanMongomongo()throwsUnknownHostException{returnnewMongo("localhost");}}pollutesthecodewiththeUnknownHostExceptioncheckedexception.Theuseofthechec