Can a simple IP address suffice as a hostname in a MongoDB URI?

Responsive Ad Header

Question

Grade: Education Subject: Support
Can a simple IP address suffice as a hostname in a MongoDB URI?
Asked by:
63 Viewed 63 Answers

Answer (63)

Best Answer
(315)
Yes, a valid IP address can be used as the hostname in a MongoDB URI. For example, `mongodb://192.168.1.100:27017` is a valid format, assuming your MongoDB server is running on that IP address and port. This bypasses the need for a traditional domain name and TLD resolution but still requires a resolvable address.