Problem Description
When connected to an Atlas cluster or Atlas Data Lake, db.getMongo() shows a connection to localhost, not the cluster/data lake.
Steps to Reproduce
$ mongosh "mongodb://<REDACTED>@loadtest-0wuse.a.query.mongodb-stage.net/?ssl=true&authSource=admin" Connecting to: mongodb://<credentials>@loadtest-0wuse.a.query.mongodb-stage.net/?ssl=true&authSource=admin ... > db.getMongo() mongodb://localhost/
Expected Results
I expected db.getMongo() to return the hostname of the data lake.
Actual Results
It returned localhost.
Additional Notes
The response format differs from the server shell.
Data lake (standalone):
> db.getMongo() connection to loadtest-0wuse.a.query.mongodb-stage.net:27017
Cluster (replica set):
MongoDB Enterprise mongohouse-dev-shard-0:PRIMARY> db.getMongo() connection to mongohouse-dev-shard-0/mongohouse-dev-shard-00-00.ki9ie.mongodb.net:27017,mongohouse-dev-shard-00-01.ki9ie.mongodb.net:27017,mongohouse-dev-shard-00-02.ki9ie.mongodb.net:27017
- is duplicated by
-
MONGOSH-943 db.getMongo() command shows wrong current database connection.
- Closed