Set Mongo Timeout in Spring Boot
<p>I am using spring boot web application which connects to mongo db which is working out of the box. I just use the following properties:</p>

<pre><code>spring.data.mongodb.host=myHost
spring.data.mongodb.port=27017
spring.data.mongodb.database=myDatabase
spring.data.mongo.repositories.enabled=true
spring.data.mongodb.username=myUser
spring.data.mongodb.password=myPassword
</code></pre>

<p>The default timeout to MongoDB is 10 seconds. I would like to configure the timeout. I tried doing
     <code>spring.data.mongodb.socketTimeout=2</code> or       <code>spring.data.mongodb.connectionTimeout=2</code></p>

<p>None of the properties work. Is it something that I can specify in the properties and the Spring framework will take care of it or can someone give example of doing it by declaring the Bean.    </p>