Alternatively, as long as you use Mongo 2.x, you can specify a `host`/`port`.
Alternatively, you can specify a `host`/`port`.
For example, you might declare the following settings in your `application.properties`:
[source,properties,indent=0,configprops]
...
...
@@ -3878,8 +3878,7 @@ For example, you might declare the following settings in your `application.prope
spring.data.mongodb.port=27017
----
If you have defined your own `MongoClient`, it will be used to auto-configure a suitable `MongoDbFactory`.
Both `com.mongodb.MongoClient` and `com.mongodb.client.MongoClient` are supported.
If you have defined your own `MongoClient`, it will be used to auto-configure a suitable `MongoDatabaseFactory`.
NOTE: If you use the Mongo 3.0 Java driver, `spring.data.mongodb.host` and `spring.data.mongodb.port` are not supported.
In such cases, `spring.data.mongodb.uri` should be used to provide all of the configuration.
...
...
@@ -3887,8 +3886,8 @@ In such cases, `spring.data.mongodb.uri` should be used to provide all of the co
TIP: If `spring.data.mongodb.port` is not specified, the default of `27017` is used.
You could delete this line from the example shown earlier.
TIP: If you do not use Spring Data Mongo, you can inject `com.mongodb.MongoClient` beans instead of using `MongoDbFactory`.
If you want to take complete control of establishing the MongoDB connection, you can also declare your own `MongoDbFactory` or `MongoClient` bean.
TIP: If you do not use Spring Data Mongo, you can inject a `MongoClient` bean instead of using `MongoDatabaseFactory`.
If you want to take complete control of establishing the MongoDB connection, you can also declare your own `MongoDatabaseFactory` or `MongoClient` bean.
NOTE: If you are using the reactive driver, Netty is required for SSL.
The auto-configuration configures this factory automatically if Netty is available and the factory to use hasn't been customized already.
...
...
@@ -3902,7 +3901,6 @@ As with `JdbcTemplate`, Spring Boot auto-configures a bean for you to inject the