Curious, is there a simple way to differentiate between clients if you per say are adding 2 mongo servers
App::new()
.app_data(web::Data::new(mongo_client.clone()))
.app_data(web::Data::new(mongo_client2.clone()))
Later on what is the preferred method to take care / loop through these clients or only specify one or the other?
async fn mongo_test(client: web::Data<Client>) -> HttpResponse {
//... do something against 1 or both DB's?
}
This is mainly a curiosity question, I'm not sure if I'll actually ever do this.