fixed database.ts (#102)

dependabot/npm_and_yarn/word-wrap-1.2.4
Skyler 3 years ago committed by GitHub
commit 15083031f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,7 +21,8 @@ if ("password" in config.mongoOptions) password = encodeURIComponent(config.mong
const mongoClient = new MongoClient(
username
? `mongodb://${username}:${password}@${config.mongoOptions.host}?authMechanism=DEFAULT&authSource=${config.mongoOptions.authSource}`
? `mongodb://${username}:${password}@${config.mongoOptions.host}/${config.mongoOptions.database}` +
`?authMechanism=DEFAULT&authSource=${config.mongoOptions.authSource}`
: `mongodb://${config.mongoOptions.host}`
);
await mongoClient.connect();

Loading…
Cancel
Save