title: Spring Data Mongo - Dynamically change repository template
body: <p>I have this scenario: same database structure (same collections) replicated in multiple mongo databases. This mean that I have one mongo repository for each collection (Document). </p>
  
  <p>Now I need to manage these databases through the same Control Panel App, connecting to each one of them dynamically, and using the same repository classes (the databases are identical). </p>
  
  <p>I know that I can specify known templates for repositories as described in this <a href="https://stackoverflow.com/questions/31681546/configure-multiple-mongodb-repositories-with-spring-data-mongo">post</a>, but this implies that I have to know the database's connection properties at startup. How can I implement a dynamic behaviour of that, instead?</p>