-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:OS:
node.js / npm versions:
Additional info:
-
Not Needed
-
Developer Tools
Problem Statement/Rationale
What is going wrong? What action would you like the Engineering team to take?
Please be sure to attach relevant logs with any sensitive data redacted.
How to retrieve logs for: Compass; Shell
In the legacy mongo, there was a function called `hostname` that would give you the current machine hostname. This is actually really useful for setting up replica sets or getting specific machine metadata.
As a workaround, we can use
require('os').hostname()
Steps to Reproduce
How could an engineer replicate the issue you’re reporting?
Call the function `hostname()` in any mongosh session.
Expected Results
What do you expect to happen?
To return the hostname of the current machine where mongosh is running.
Actual Results
What do you observe is happening?
Additional Notes
Slack thread: https://mongodb.slack.com/archives/CUHC9R8J0/p1712739475434539