Skip to content

Clarify which Mongo properties are ignored when URI property is set #44384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -52,19 +52,19 @@ public class MongoProperties {
public static final String DEFAULT_URI = "mongodb://localhost/test";

/**
* Mongo server host. Cannot be set with URI.
* Mongo server host. Ignored if Mongo 'uri' is specified.
*/
private String host;

/**
* Mongo server port. Cannot be set with URI.
* Mongo server port. Ignored if Mongo 'uri' is specified.
*/
private Integer port = null;

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

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

/**
* Login user of the mongo server. Cannot be set with URI.
* Login user of the mongo server. Ignored if Mongo 'uri' is specified.
*/
private String username;

/**
* Login password of the mongo server. Cannot be set with URI.
* Login password of the mongo server. Ignored if Mongo 'uri' is specified.
*/
private char[] password;

/**
* Required replica set name for the cluster. Cannot be set with URI.
* Required replica set name for the cluster. Ignored if Mongo 'uri' is specified.
*/
private String replicaSetName;

Expand Down