mirror of
https://github.com/gofiber/storage.git
synced 2025-10-06 00:57:38 +08:00
Ignore port when using Atlas
This commit is contained in:
@@ -48,7 +48,11 @@ func New(config ...Config) *Storage {
|
||||
if cfg.Username != "" || cfg.Password != "" {
|
||||
dsn += "@"
|
||||
}
|
||||
if cfg.Atlas == true {
|
||||
dsn += url.QueryEscape(cfg.Host) // Cannot specify port when using MongoDB Atlas
|
||||
} else {
|
||||
dsn += fmt.Sprintf("%s:%d", url.QueryEscape(cfg.Host), cfg.Port)
|
||||
}
|
||||
|
||||
// Set mongo options
|
||||
opt := options.Client()
|
||||
|
Reference in New Issue
Block a user