Apologies for resurrecting this old thread, but I have the exact same question and the answer doesn't really make sense to me: "The driver will handle load balancing".
We have a 3 server MongoDB replica set in an AWS environment. When PRIMARY goes down, a SECONDARY gets promoted, so that's all well and good. We use Jenkins to deploy code and specify the PRIMARY MongoDB server by name and the data gets replicated, which is also well and good. But when I kill the PRIMARY, it breaks the app. Even though a SECONDARY gets promoted to PRIMARY, the app itself is still trying to hit the original MongoDB server and is not routing properly.
So I'm left baffled as to how, if our app is pointing to MongoDB_Server_1, it will continue to function if MongoDB_Server_2 is now PRIMARY?
I'm obviously new to this whole AWS/MongoDB thing. Any help is greatly appreciated.
Thank you.