MongoDB is not working

I installed the mongoose library and entered the DB connection into the code, but it does not work, there are no errors in the console
const mongoose = require('mongoose');
const mongodbURL = process.env.MONGODBURL;
mongoose.set('strictQuery', false);


module.exports = {
name: 'ready',
once: true,
async execute(client) {
console.log('Ready!');

if (!mongodbURL) return;

await mongoose.connect(mongodbURL || '', {
keepAlive: true,
useNewUrlParser: true,
useUnifiedTopology: true
})


if (mongoose.connect) {
console.log('MongoDB ready!')
}

.........
};
const mongoose = require('mongoose');
const mongodbURL = process.env.MONGODBURL;
mongoose.set('strictQuery', false);


module.exports = {
name: 'ready',
once: true,
async execute(client) {
console.log('Ready!');

if (!mongodbURL) return;

await mongoose.connect(mongodbURL || '', {
keepAlive: true,
useNewUrlParser: true,
useUnifiedTopology: true
})


if (mongoose.connect) {
console.log('MongoDB ready!')
}

.........
};
3 Replies
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
treble/luna
treble/luna17mo ago
Not djs related, #other-js-ts
Обкуренный
Okay
Want results from more Discord servers?
Add your server