Skip to content

Commit

Permalink
update mongo field.
Browse files Browse the repository at this point in the history
  • Loading branch information
mo3et committed Dec 13, 2024
1 parent c28fe6a commit 26b4170
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/mongodb.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# URI for database connection, leave empty if using address and credential settings directly
uri: ''
uri: ""
# List of MongoDB server addresses
address: [ localhost:37017 ]
address: [localhost:37017]
# Name of the database
database: openim_v3
# Username for database authentication
username: openIM
# Password for database authentication
password: openIM123
# Authentication source for database authentication, if use root user, set it to admin
authSource: openim_v3
# Maximum number of connections in the connection pool
maxPoolSize: 100
# Maximum number of retry attempts for a failed database connection
Expand Down
2 changes: 2 additions & 0 deletions pkg/common/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Mongo struct {
Database string `mapstructure:"database"`
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
AuthSource string `mapstructure:"authSource"`
MaxPoolSize int `mapstructure:"maxPoolSize"`
MaxRetry int `mapstructure:"maxRetry"`
}
Expand All @@ -60,6 +61,7 @@ func (m *Mongo) Build() *mongoutil.Config {
Database: m.Database,
Username: m.Username,
Password: m.Password,
AuthSource: m.AuthSource,
MaxPoolSize: m.MaxPoolSize,
MaxRetry: m.MaxRetry,
}
Expand Down

0 comments on commit 26b4170

Please sign in to comment.