How to set connection timeout for Mongodb using pymongo? January 6, 2024 by Tarik So if anyone comes across this later, I was using the wrong option. What I was looking for is serverSelectionTimeoutMS