Spring Data Mongodb - single configuration for standalone mongo and replicaset
<p>I started out with a single mongo instance as my database, configured in spring xml:</p>

<pre><code>&lt;mongo:mongo host="localhost" port="27017" /&gt;
</code></pre>

<p>Recently, I changed my configuration to use a 3 node replica set, configured as:</p>

<pre><code>&lt;mongo:mongo replica-set="${my.replica.set}" /&gt;
</code></pre>

<p>Everything works great.</p>

<p>My current problem is that for my dev environment I'd like to use the single localhost mongo config and for int and prod envrionments I'd like to use the replica set config.  The differing values I will handle via properties files.  The question is about the mongo config itself.</p>

<p>Something along the lines of the example below would be ideal...</p>

<pre><code>&lt;mongo:mongo uri="localhost:27017" /&gt;
&lt;mongo:mongo uri="localhost:27017,localhost:27018" /&gt;
</code></pre>

<p>I ran into this example: <a href="https://github.com/spring-projects/spring-boot/blob/3048f44a964ab2390dff26f0818c941ba40bdc56/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java#L109" rel="nofollow">spring-boot uriCanBeCustomized unitTest</a></p>

<p>Is there a way to do this in spring config?</p>

<p>I am using spring-data-mongodb-1.7.0.RELEASE.</p>