I was trying to connect my client with MongoDB, but I got an error: MongoParseError: option useunifedtopology is not supported. I don't know why this is happening, I will be very grateful for your help, this is my code:
const { Databse } = require("../../config.json");
module.exports = {
name: "ready",
once: true,
execute(client) {
console.log("The client is now ready!");
if(!Databse) return;
mongoose.connect(Databse, {
useNewUrlParser: true,
useUnifedTopology: true
}).then(() => {
console.log("The client is now connected with the Database!")
}).catch((err) => {
console.log(err)
})
}
}
Once again, the error is caused due to a typo. Please just, before posting a question, go through your code to see if there are any potential typos here and there. Here, when calling the mongoose.connect() function you are giving it an option called useUnifedTopology without an 'i' in the 'unifed'. So, you can just correct that and you should be good to go