From 4ddab67939a4cf9732a7885d37fbe291c456dcd9 Mon Sep 17 00:00:00 2001 From: Thiago Lagden Date: Fri, 5 Jan 2024 20:48:03 -0300 Subject: [PATCH] fix connectionOptions --- .gitignore | 2 +- package.json | 2 +- src/mongo.js | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bd94284..eb46981 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ coverage node_modules -test/helper/**/* \ No newline at end of file +test/helper/.cache/** \ No newline at end of file diff --git a/package.json b/package.json index e15cf6b..51c030b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tadashi/mongo-singleton", - "version": "6.0.2", + "version": "6.0.3", "description": "Simplifying MongoDB", "files": [ "src", diff --git a/src/mongo.js b/src/mongo.js index aede998..6b1c1ab 100644 --- a/src/mongo.js +++ b/src/mongo.js @@ -77,6 +77,8 @@ async function createConnectionOptions(args = {}) { password: await readSecrets(password), } } + + return connectionOptions } /** @@ -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