I have solved this issue by calling my host provider and asking them to allow me a specific port so that my website can connect to it. The port was 27017