Skip to content

Commit ecda57b

Browse files
author
PGamerX
committed
Fix mongoDB
1 parent fdb8cb6 commit ecda57b

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

bot.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,14 @@ const mongoose = require("mongoose");
143143
const dbURI = process.env.DBURI;
144144

145145
// noinspection JSCheckFunctionSignatures
146-
mongoose.connect(dbURI).then((whatever) => {
147-
console.log("owo did it work");
148-
});
146+
mongoose
147+
.connect(dbURI, {
148+
useNewUrlParser: true,
149+
useUnifiedTopology: true,
150+
})
151+
.then(() => {
152+
console.log("owo did it work");
153+
});
149154

150155
// noinspection JSCheckFunctionSignatures
151156

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ const dbURI = process.env.DBURI;
1717

1818
const mongoose = require("mongoose");
1919
// noinspection JSCheckFunctionSignatures
20-
mongoose.connect(dbURI).then((whatever) => {
21-
console.log("owo did it work");
22-
});
20+
mongoose
21+
.connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true })
22+
.then((whatever) => {
23+
console.log("owo did it work");
24+
});
2325

2426
const manager = new ShardingManager("./bot.js", { token: token });
2527

0 commit comments

Comments
 (0)