While using the code mentioned in How to connect remote mongodb with pymongo I am able to connect to the remote mongodb where the local host machine does not have a mongodb. If the local host machine (from where the code is executed) has a mongodb, the scripts connect to the local mongodb & not the remote one.
I was expecting that the code will connect to remote mongodb but the code was connecting to local mongodb.