Problem Statement/Rationale
After connecting to a remote deployment from a Windows 10 client, mongosh does not show the current database connection.
Steps to Reproduce
- Connect to remote database from local client (Windows 10): mongosh "mongodb://mongodb0.example.com:28015,mongodb1.example.com:28015,mongodb2.example.com:28015/?replicaSet=ReplA" --username alice --authenticationDatabase admin
- Current sessionID: 1c3fcd0b24f9508dec399a51
Connecting to: mongodb0.example.com:28015,mongodb1.example.com:28015,mongodb2.example.com:28015/?replicaSet=ReplA
Using MongoDB: 4.4.0-1
Using Mongosh Beta: 0.1.0
For more information about mongosh, please see our docs: https://docs.mongodb.com/mongodb-shell/
- Run db.getMongo()
Expected Results
mongodb0.example.com:28015,mongodb1.example.com:28015,mongodb2.example.com:28015/?replicaSet=ReplA
Actual Results
It shows localhost instead of the current database connection
> db.getMongo()
mongodb://localhost/
Additional Notes
Any additional information that may be useful to include.
- duplicates
-
MONGOSH-557 db.getMongo() gives localhost when connected to Atlas and Atlas Data Lakes
- Closed