config auth for spring-mongo-data
<p><strong>Environment</strong></p>

<p>spring-boot 1.3.2</p>

<p>spring-mongo 0.8.0</p>

<p>build my spring-boot microservice with gradle.</p>

<p><strong>Problem</strong></p>

<p>one of mongo database enable the auth,so i configure these arguments in application.yml</p>

<p><code>spring:
    data: 
        mongo:
           username:xxx
           password:xxx
           authentication-database:xxx
</code>  </p>

<p>it works well for mongodb which has set the auth.</p>

<p><strong>but I got error with mongdb which has not set the auth</strong>
even I set the username="",password="".it fail with auth.</p>

<blockquote>
  <p>Caused by: com.mongodb.CommandFailureException: { "serverUsed" : "localhost:27017" , "ok" : 0.0 , "code" : 18 , "errmsg" : "Authentication failed."}
      at com.mongodb.CommandResult.getException(CommandResult.java:76) ~[mongo-java-driver-2.13.3.jar:na]
      at com.mongodb.CommandResult.throwOnError(CommandResult.java:140) ~[mongo-java-driver-2.13.3.jar:na]
      at com.mongodb.DBPort$SaslAuthenticator.authenticate(DBPort.java:903) ~[mongo-java-driver-2.13.3.jar:na]
      at com.mongodb.DBPort.authenticate(DBPort.java:436) ~[mongo-java-driver-2.13.3.jar:na]
      at com.mongodb.DBPort.checkAuth(DBPort.java:447) ~[mongo-java-driver-2.13.3.jar:na]
      at com.mongodb.DBTCPConnector.doOperation(DBTCPConnector.java:207) ~[mongo-java-driver-2.13.3.jar:na]
      at com.mongodb.DBCollectionImpl.createIndex(DBCollectionImpl.java:392) ~[mongo-java-driver-2.13.3.jar:na]
      at com.mongodb.DBCollection.createIndex(DBCollection.java:597) ~[mongo-java-driver-2.13.3.jar:na]</p>
</blockquote>

<p><strong>My question is how to remove the mongo.username,password key dynamic for these mongo db which has not set auth?</strong></p>

<p>also I am curious about why cannot remove the key in application.yml file.while have seen that we can automatic property expansion using Maven or gradle in this document:<a href="http://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html" rel="nofollow">property expansion</a></p>

<p><strong>Update</strong>
if just leave these key empty,still get error</p>

<p>The full response is { "ok" : 0.0, "errmsg" : "Invalid database name: ''", "code" : 73 }}}]</p>