Error connecting to MongoDB: MongooseServerSelectionError

Hi I’m trying for the first time the mongoDB i found a tutorial online when I followed it(I checked every code I think I followed it correctly it just a little line of code trying to connect on MongoDB anyway) and I got this error:
Error connecting to MongoDB: MongooseServerSelectionError: 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://www.mongodb.com/docs/atlas/security-whitelist/
at _handleConnectionErrors (D:\Client\doctors-appointment\backend\node_modules\mongoose\lib\connection.js:909:11)
at NativeConnection.openUri (D:\Client\doctors-appointment\backend\node_modules\mongoose\lib\connection.js:860:11)
at async connectDB (file:///D:/Client/doctors-appointment/backend/config/mongodb.js:19:5) {
reason: TopologyDescription {
type: ‘ReplicaSetNoPrimary’,
servers: Map(3) {
cluster0-shard-00-01.jkv76.mongodb.net:27017’ => [ServerDescription],
cluster0-shard-00-00.jkv76.mongodb.net:27017’ => [ServerDescription],
cluster0-shard-00-02.jkv76.mongodb.net:27017’ => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: ‘atlas-x4vrsl-shard-0’,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}
[nodemon] app crashed - waiting for file changes before starting…

I tried searching for answer in the internet the most popular one is
MongoDB Atlas → NetworkAccess → Edit → Allowed Access from Anywhere

I setup my Network access 0.0.0.0/0

and ensure it’s active then restart the server and then npm run server

I still getting the same error . I don’t know what to do I also tried chatGPT lol but it gives me confusing tips to check but it did not help at all thanks for the help