When attempting to connect to MongoDB, I encountered the error message: "throw new MongooseError('Mongoose.prototype.connect() no longer accepts a callback');"
const mongoURI = "mongodb://localhost:27017/?directConnection=true";
const connectToMongo = () => {
mongoose.connect(mongoURI,() => {
console.log("Connected to Mongo Successfully");
})
}
module.exports = connectToMongo;