diff --git a/CHANGELOG.md b/CHANGELOG.md
index d5870e2ce..a296c5c98 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@
* 【extra 】 修复Sftp.mkDirs报错问题(issue#1536@Github)
* 【core 】 修复Bcrypt不支持$2y$盐前缀问题(pr#1560@Github)
* 【system 】 修复isWindows8拼写问题(pr#1557@Github)
+* 【db 】 修复MongoDS默认分组参数失效问题(issue#1548@Github)
-------------------------------------------------------------------------------------------------------------
diff --git a/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java b/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java
index 85f84bea8..8158f0d33 100644
--- a/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java
+++ b/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java
@@ -21,7 +21,7 @@ import java.util.List;
/**
* MongoDB工具类
- *
+ *
* @author xiaoleilu
*
*/
@@ -44,7 +44,7 @@ public class MongoDS implements Closeable {
/**
* 构造MongoDB数据源
* 调用者必须持有MongoDS实例,否则会被垃圾回收导致写入失败!
- *
+ *
* @param host 主机(域名或者IP)
* @param port 端口
*/
@@ -56,7 +56,7 @@ public class MongoDS implements Closeable {
/**
* 构造MongoDB数据源
* 调用者必须持有MongoDS实例,否则会被垃圾回收导致写入失败!
- *
+ *
* @param mongoSetting MongoDB的配置文件,如果是null则读取默认配置文件或者使用MongoDB默认客户端配置
* @param host 主机(域名或者IP)
* @param port 端口
@@ -71,7 +71,7 @@ public class MongoDS implements Closeable {
* 构造MongoDB数据源
* 当提供多个数据源时,这些数据源将为一个副本集或者多个mongos
* 调用者必须持有MongoDS实例,否则会被垃圾回收导致写入失败! 官方文档: http://docs.mongodb.org/manual/administration/replica-sets/
- *
+ *
* @param groups 分组列表,当为null或空时使用无分组配置,一个分组使用单一模式,否则使用副本集模式
*/
public MongoDS(String... groups) {
@@ -84,7 +84,7 @@ public class MongoDS implements Closeable {
* 当提供多个数据源时,这些数据源将为一个副本集或者mongos
* 调用者必须持有MongoDS实例,否则会被垃圾回收导致写入失败!
* 官方文档: http://docs.mongodb.org/manual/administration/replica-sets/
- *
+ *
* @param mongoSetting MongoDB的配置文件,必须有
* @param groups 分组列表,当为null或空时使用无分组配置,一个分组使用单一模式,否则使用副本集模式
*/
@@ -112,16 +112,16 @@ public class MongoDS implements Closeable {
/**
* 初始化
* 设定文件中的host和端口有三种形式:
- *
+ *
*
* host = host:port *- * + * *
* host = host * port = port *- * + * *
* host = host *@@ -162,15 +162,15 @@ public class MongoDS implements Closeable { * 初始化集群
* user = test1 * pass = 123456 * database = test * [db0] - * host = 192.168.1.1:27117 + * host = 192.168.1.1:27117 * [db1] - * host = 192.168.1.1:27118 + * host = 192.168.1.1:27118 * [db2] * host = 192.168.1.1:27119 *@@ -207,7 +207,7 @@ public class MongoDS implements Closeable { /** * 设定MongoDB配置文件 - * + * * @param setting 配置文件 */ public void setSetting(Setting setting) { @@ -223,7 +223,7 @@ public class MongoDS implements Closeable { /** * 获得DB - * + * * @param dbName DB * @return DB */ @@ -233,7 +233,7 @@ public class MongoDS implements Closeable { /** * 获得MongoDB中指定集合对象 - * + * * @param dbName 库名 * @param collectionName 集合名 * @return DBCollection @@ -250,8 +250,8 @@ public class MongoDS implements Closeable { // --------------------------------------------------------------------------- Private method start /** * 创建ServerAddress对象,会读取配置文件中的相关信息 - * - * @param group 分组,如果为null默认为无分组 + * + * @param group 分组,如果为{@code null}或者""默认为无分组 * @return ServerAddress */ private ServerAddress createServerAddress(String group) { @@ -272,7 +272,7 @@ public class MongoDS implements Closeable { /** * 创建ServerAddress对象 - * + * * @param host 主机域名或者IP(如果为空默认127.0.0.1) * @param port 端口(如果为空默认为) * @return ServerAddress @@ -284,7 +284,7 @@ public class MongoDS implements Closeable { /** * 创建{@link MongoCredential},用于服务端验证