mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
compose db conn params
This commit is contained in:
parent
7ca70d013d
commit
1782565692
@ -19,19 +19,22 @@ function getConnectionConfig(obj) {
|
|||||||
auth.push("/?authMechanism=DEFAULT")
|
auth.push("/?authMechanism=DEFAULT")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DB_AUTH_SOURCE && DB_USER) {
|
auth = auth.join("")
|
||||||
auth.push(`&authSource=${DB_AUTH_SOURCE}`)
|
|
||||||
|
const params = {
|
||||||
|
auth: {},
|
||||||
|
dbName: DB_NAME,
|
||||||
|
useNewUrlParser: true,
|
||||||
|
useUnifiedTopology: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
auth = auth.join("")
|
if (DB_AUTH_SOURCE) {
|
||||||
|
params.auth.authSource = DB_AUTH_SOURCE
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
auth,
|
auth,
|
||||||
{
|
params,
|
||||||
dbName: DB_NAME,
|
|
||||||
useNewUrlParser: true,
|
|
||||||
useUnifiedTopology: true,
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user