From ecda57bdc8097d5c83d735233995dd41999fdec6 Mon Sep 17 00:00:00 2001 From: PGamerX Date: Tue, 29 Mar 2022 16:59:33 +0530 Subject: [PATCH] Fix mongoDB --- bot.js | 11 ++++++++--- index.js | 8 +++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bot.js b/bot.js index a6222b2..3df946c 100644 --- a/bot.js +++ b/bot.js @@ -143,9 +143,14 @@ const mongoose = require("mongoose"); const dbURI = process.env.DBURI; // noinspection JSCheckFunctionSignatures -mongoose.connect(dbURI).then((whatever) => { - console.log("owo did it work"); -}); +mongoose + .connect(dbURI, { + useNewUrlParser: true, + useUnifiedTopology: true, + }) + .then(() => { + console.log("owo did it work"); + }); // noinspection JSCheckFunctionSignatures diff --git a/index.js b/index.js index ef117be..d2a1990 100644 --- a/index.js +++ b/index.js @@ -17,9 +17,11 @@ const dbURI = process.env.DBURI; const mongoose = require("mongoose"); // noinspection JSCheckFunctionSignatures -mongoose.connect(dbURI).then((whatever) => { - console.log("owo did it work"); -}); +mongoose + .connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true }) + .then((whatever) => { + console.log("owo did it work"); + }); const manager = new ShardingManager("./bot.js", { token: token });