반응형
mong
@Configuration
public class MongoDbConfiguration extends AbstractMongoClientConfiguration {
@Value("${mongoDbUrl}")
private String mongoDdUrl ;
@Override
public MongoClient mongoClient() {
final ConnectionString connectionString = new ConnectionString(mongoDdUrl);
final MongoClientSettings mongoClientSettings = MongoClientSettings.builder()
.applyConnectionString(connectionString)
.build();
return MongoClients.create(mongoClientSettings);
}
}
반응형
'데이터베이스 > mongoDB' 카테고리의 다른 글
[mongoDB] MongoDB Atlas 사용법 (0) | 2022.11.17 |
---|
댓글