When i am trying to connect to my mongodb database with the given script it gives me error that the ip address might be not present there i have added that ip address so it so i choose option from allow all ip address it is also giving error
const express = require('express');
const mongoose = require('mongoose');
const app = express();
const uri = "mongodb+srv://sarang:<pasword####>@maindatabase.zxgjd.mongodb.net/maindatabase?retryWrites=true&w=majority";
const PORT = 7000;
console.log("The server is preparing to run")
mongoose.connect(uri).then(()=>{
app.listen(PORT,()=>{
console.log(`Server is running on ${PORT}`)
})
}).catch(error =>{
console.log(error.message)
})
and the error is
The server is preparing to run
Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/