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 (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -46,6 +47,7 @@ func New(config ...Config) *Storage {
|
|||||||
if cfg.Username != "" || cfg.Password != "" {
|
if cfg.Username != "" || cfg.Password != "" {
|
||||||
dsn += "@"
|
dsn += "@"
|
||||||
}
|
}
|
||||||
|
dsn += fmt.Sprintf("%s:%d", url.QueryEscape(cfg.Host), cfg.Port)
|
||||||
|
|
||||||
// Set mongo options
|
// Set mongo options
|
||||||
opt := options.Client()
|
opt := options.Client()
|
||||||
|
Reference in New Issue
Block a user