mirror of
https://github.com/gofiber/storage.git
synced 2025-12-24 05:08:39 +08:00
Add support for MongoDB Atlas
This commit is contained in:
@@ -33,7 +33,12 @@ func New(config ...Config) *Storage {
|
||||
cfg := configDefault(config...)
|
||||
|
||||
// Create data source name
|
||||
var dsn = "mongodb://"
|
||||
var dsn = "mongodb"
|
||||
if cfg.Atlas == true {
|
||||
dsn += "+srv://"
|
||||
} else {
|
||||
dsn += "://"
|
||||
}
|
||||
if cfg.Username != "" {
|
||||
dsn += url.QueryEscape(cfg.Username)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user