Improve MongoDB documentation

Explicitly mention that `spring.data.mongodb.uri` can be used to
customize additional settings such as replica set.

Closes gh-2624
This commit is contained in:
Stephane Nicoll 2015-08-05 15:06:12 +02:00
parent 0822b1ce11
commit 89c3d2ea12
1 changed files with 10 additions and 3 deletions

View File

@ -2505,9 +2505,16 @@ server using the URL `mongodb://localhost/test`:
}
----
You can set `spring.data.mongodb.uri` property to change the `url`, or alternatively
specify a `host`/`port`. For example, you might declare the following in your
`application.properties`:
You can set `spring.data.mongodb.uri` property to change the `url` and configure
additional settings such as the _replica set_:
[source,properties,indent=0]
----
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`:
[source,properties,indent=0]
----