We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02beee3 commit 62544f4Copy full SHA for 62544f4
mongo-csv.js
@@ -15,13 +15,19 @@ const query = config.query || {};
15
const projection = config.projection || {};
16
17
(async function() {
18
+ const auth = (process.env.MONGO_USER || config.mongoUser)
19
+ ? {
20
+ auth: {
21
+ user: process.env.MONGO_USER || config.mongoUser,
22
+ password: process.env.MONGO_PASSWORD || config.mongoPassword,
23
+ },
24
+ }
25
+ : {};
26
+
27
const client = new MongoClient(url, {
- auth: {
- user: process.env.MONGO_USER || config.mongoUser,
- password: process.env.MONGO_PASSWORD || config.mongoPassword,
- },
28
useNewUrlParser: true,
29
authSource: authDb,
30
+ ...auth,
31
});
32
33
try {
0 commit comments