My config for using a single mongo repo looks like this:
@Configuration
@EnableMongoRepositories
public class ApplicationConfig extends AbstractReactiveMongoConfigutation {
@Autowired
private Environment env;
@Value("${spring.data.mongodb.uri}")
private String mongoUri;
@Override
protected String getDatabaseName(){
return env.getProperty("spring.data.mongodb.database");
}
@Override
protected void configureClientSettings(MongoClientSettings.Builder builder){
builder.applyConnectionString(new ConnectionString(mongoUri)));
}
}
how would I create another instance of a mongodb connection? I have tried creating a second config class with the other connection String but it didn't work. Thanks