When we connect a Node.js application to a cluster on the mongoDB Atlas, we need to add the following URI instead of adding "mongodb://localhost:27017/<dbname>" as you can see at the step 2 in the image.
"mongodb+srv://<username>:<password>@cluster1.tv7cp.mongodb.net/<dbname>?retryWrites=true&w=majority"
Now, what exactly the meaning of ?retryWrites=true&w=majority in it after <dbname>? Why do we need to add it?
I tried and ran the app with mongoose without ?retryWrites=true&w=majority, and it worked fine.
