Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
3.5.1
-
None
-
ALL
-
Platforms 2017-01-23
Description
When connecting using mongo client (command line, windows), if the address given is invalid, mongo client will connect to localhost instance, without giving any errors. This happens if you provide only a part of the server full URI. Example:
mongo myserver -> connects to localhost, no error message. nslookup myserver returns server ip address, not mine.
mongo myserver.fulldomain.com -> connects to myserver correctly.
Not sure if it's a bug or it's by design (a previously taken decision), and I wasn't able to find anything on the matter. If it's by design I'd vote to change this to improvement and ask for a warning message (someone might really think they are acting on 'myserver' when it's acting on 'localhost' really - and if both localhost and myserver belongs to the same replicaSet, the prompt will be the same 'replicaSetName:SECONDARY').