In v3.4 the following no longer works
mongo --host replset/localhost:27018 MongoDB shell version v3.4.0 connecting to: mongodb://replset/localhost:27018 2016-12-05T21:45:22.474+0000 E QUERY [main] Error: Failed to parse mongodb:// URL: mongodb://replset/localhost:27018 : connect@src/mongo/shell/mongo.js:234:13 @(connect):1:6 exception: connect failed
Where it used to work in v3.2
usr/local/m/versions/3.2.10/bin$ ./mongo --host replset/localhost:27018
MongoDB shell version: 3.2.10
connecting to: replset/localhost:27018/test
The documentation has an example.
- is duplicated by
-
SERVER-27731 MongoDB 3.4.1 shell still unable to connect to replicaset via --host
- Closed
-
SERVER-27404 Mongo shell `--host` option for replica sets broken in 3.4
- Closed
-
SERVER-27417 Failed to parse host option if replica set name is specified
- Closed
- is related to
-
SERVER-28072 Running a script using 'mongo' on replication set fails
- Closed
- related to
-
SERVER-22382 mongo shell should accept mongodb:// URI for --host
- Closed