Skip to content

Commit 2f288bf

Browse files
nosansnicoll
authored andcommitted
Clarify which Mongo properties are ignored when URI property is set
See gh-44384 Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
1 parent 58a9280 commit 2f288bf

File tree

1 file changed

+9
-9
lines changed
  • spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo

1 file changed

+9
-9
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,19 +52,19 @@ public class MongoProperties {
5252
public static final String DEFAULT_URI = "mongodb://localhost/test";
5353

5454
/**
55-
* Mongo server host. Cannot be set with URI.
55+
* Mongo server host. Ignored if Mongo 'uri' is specified.
5656
*/
5757
private String host;
5858

5959
/**
60-
* Mongo server port. Cannot be set with URI.
60+
* Mongo server port. Ignored if Mongo 'uri' is specified.
6161
*/
6262
private Integer port = null;
6363

6464
/**
65-
* Additional server hosts. Cannot be set with URI or if 'host' is not specified.
66-
* Additional hosts will use the default mongo port of 27017. If you want to use a
67-
* different port you can use the "host:port" syntax.
65+
* Additional server hosts. Ignored if a Mongo 'uri' is provided or if 'host' is
66+
* omitted. Additional hosts will use the default mongo port of 27017. If you want to
67+
* use a different port you can use the "host:port" syntax.
6868
*/
6969
private List<String> additionalHosts;
7070

@@ -86,17 +86,17 @@ public class MongoProperties {
8686
private final Gridfs gridfs = new Gridfs();
8787

8888
/**
89-
* Login user of the mongo server. Cannot be set with URI.
89+
* Login user of the mongo server. Ignored if Mongo 'uri' is specified.
9090
*/
9191
private String username;
9292

9393
/**
94-
* Login password of the mongo server. Cannot be set with URI.
94+
* Login password of the mongo server. Ignored if Mongo 'uri' is specified.
9595
*/
9696
private char[] password;
9797

9898
/**
99-
* Required replica set name for the cluster. Cannot be set with URI.
99+
* Required replica set name for the cluster. Ignored if Mongo 'uri' is specified.
100100
*/
101101
private String replicaSetName;
102102

0 commit comments

Comments
 (0)