MongooseError: Mongoose.prototype.connect() no longer accepts a callback at Mongoose.connect
throw new MongooseError('Mongoose.prototype.connect() no longer accepts a callback'); ^ The dependencies in the project are: "dependencies": { "express": "^4.18.2", "mongoose": "^7.0.3" }, "devDependencies": { "nodemon": "^2.0.22" } Following is the code snippet in 'db.js': const mongoose = require("mongoose"); const mongoURI = "mongodb://localhost:27017/"; const connectToMongo = () => { mongoose.connect(mongoURI, () => { console.log("Connected to Mongo Successfully!"); }); }; module.exports = connectToMongo; Also, the code snippet from 'index.js': const connectToMongo = require("./db"); connectToMongo(); For further info, I'll attach the screenshots below: https://www.sololearn.com/post/1731676/?ref=app