Skip to content

Commit

Permalink
fix connectionOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
lagden committed Jan 5, 2024
1 parent 0c8e35c commit 4ddab67
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,3 +1,3 @@
coverage
node_modules
test/helper/**/*
test/helper/.cache/**
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@tadashi/mongo-singleton",
"version": "6.0.2",
"version": "6.0.3",
"description": "Simplifying MongoDB",
"files": [
"src",
Expand Down
6 changes: 6 additions & 0 deletions src/mongo.js
Expand Up @@ -77,6 +77,8 @@ async function createConnectionOptions(args = {}) {
password: await readSecrets(password),
}
}

return connectionOptions
}

/**
Expand All @@ -96,6 +98,10 @@ async function conn(args = {}) {
} = args

const connectionOptions = await createConnectionOptions(restArgs)

debug.info('conn | url', url)
debug.info('conn | connectionOptions', connectionOptions)

const client = await MongoClient.connect(url, connectionOptions)

mongoSingleton[CLIENT_KEY] = client
Expand Down

0 comments on commit 4ddab67

Please sign in to comment.