mongo use auth-source (#1635)

Co-authored-by: 01471076 <yangyunsheng.it@haier.com>
This commit is contained in:
yunsheng
2024-01-20 12:33:27 +08:00
committed by GitHub
parent 26606f138d
commit 07cde689b1
3 changed files with 5 additions and 2 deletions

View File

@@ -54,8 +54,9 @@ func (m *mongo) Initialization() error {
SocketTimeoutMS: &global.GVA_CONFIG.Mongo.SocketTimeoutMs,
ConnectTimeoutMS: &global.GVA_CONFIG.Mongo.ConnectTimeoutMs,
Auth: &qmgo.Credential{
Username: global.GVA_CONFIG.Mongo.Username,
Password: global.GVA_CONFIG.Mongo.Password,
Username: global.GVA_CONFIG.Mongo.Username,
Password: global.GVA_CONFIG.Mongo.Password,
AuthSource: global.GVA_CONFIG.Mongo.AuthSource,
},
}, opts...)
if err != nil {