From b631fa140593ae91308d5a8f85701d6dda2a5324 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 27 Jul 2020 14:46:30 +0100 Subject: [PATCH] Describe MongoClientSettingsBuilderCustomizer in the documentation Closes gh-21696 --- .../src/main/asciidoc/spring-boot-features.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index d5bf5fd785..8de51231b0 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -3962,6 +3962,10 @@ For example, you might declare the following settings in your `application.prope 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. +The auto-configured `MongoClient` is created using `MongoClientSettings`. +To fine-tune its configuration, declare one or more `MongoClientSettingsBuilderCustomizer` beans. +Each will be called in order with the `MongoClientSettings.Builder` that is used to build the `MongoClientSettings`. + 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.