Document the need to use spring.data.mongodb.uri with Mongo 3.0

Closes gh-4051
This commit is contained in:
Andy Wilkinson 2015-10-05 15:18:41 +01:00
parent cff1eea4c4
commit 2292cff1ea

View File

@ -2582,8 +2582,8 @@ additional settings such as the _replica set_:
spring.data.mongodb.uri=mongodb://user:secret@mongo1.example.com:12345,mongo2.example.com:23456/test
----
Alternatively, specify a `host`/`port`. For example, you might declare the following in
your `application.properties`:
Alternatively, as long as you're using Mongo 2.x, specify a `host`/`port`. For example,
you might declare the following in your `application.properties`:
[source,properties,indent=0]
----
@ -2591,6 +2591,10 @@ your `application.properties`:
spring.data.mongodb.port=27017
----
NOTE: `spring.data.mongodb.host` and `spring.data.mongodb.port` are not supported if
you're using the Mongo 3.0 Java driver. In such cases, `spring.data.mongodb.uri` should be
used to provide all of the configuration.
TIP: If `spring.data.mongodb.port` is not specified the default of `27017` is used. You
could simply delete this line from the sample above.