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:
parent
0822b1ce11
commit
89c3d2ea12
|
|
@ -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
|
You can set `spring.data.mongodb.uri` property to change the `url` and configure
|
||||||
specify a `host`/`port`. For example, you might declare the following in your
|
additional settings such as the _replica set_:
|
||||||
`application.properties`:
|
|
||||||
|
[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]
|
[source,properties,indent=0]
|
||||||
----
|
----
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue