The mongo shell connects to the default port when the connection string is incorrect and it prints a misleading message to the user leading them to believe they have connected correctly.
- v3.0.14
mongo port=27018 MongoDB shell version: 3.0.14 connecting to: port=27018
- v3.2.10
mongo port=27018 MongoDB shell version: 3.2.10 connecting to: port=27018
- v3.4.0-rc3
mongo port=27018 MongoDB shell version v3.4.0-rc3 connecting to: mongodb://127.0.0.1:27017/port=27018
The latest version is probably the least likely to be confusing but perhaps a failure to connect would be more educational to the user.