mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 08:37:10 +08:00
Update mongodb.go
This commit is contained in:
@@ -3,6 +3,7 @@ package mongodb
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -46,6 +47,7 @@ func New(config ...Config) *Storage {
|
||||
if cfg.Username != "" || cfg.Password != "" {
|
||||
dsn += "@"
|
||||
}
|
||||
dsn += fmt.Sprintf("%s:%d", url.QueryEscape(cfg.Host), cfg.Port)
|
||||
|
||||
// Set mongo options
|
||||
opt := options.Client()
|
||||
|
Reference in New Issue
Block a user