db.hostInfo()
On this page
db.hostInfo()
Returns a document with information about the underlying system that the
mongod
ormongos
runs on. Some of the returned fields are only included on some platforms.db.hostInfo()
provides amongosh
helper method around thehostInfo
command. The output ofdb.hostInfo()
on a Linux system will resemble the following:{ "system" : { "currentTime" : ISODate("<timestamp>"), "hostname" : "<hostname>", "cpuAddrSize" : <number>, "memSizeMB" : <number>, "memLimitMB" : <number>, "numCores" : <number>, "cpuArch" : "<identifier>", "numaEnabled" : <boolean> }, "os" : { "type" : "<string>", "name" : "<string>", "version" : "<string>" }, "extra" : { "versionString" : "<string>", "libcVersion" : "<string>", "kernelVersion" : "<string>", "cpuFrequencyMHz" : "<string>", "cpuFeatures" : "<string>", "pageSize" : <number>, "numPages" : <number>, "maxOpenFiles" : <number> }, "ok" : <return> } See
hostInfo
for full documentation of the output ofdb.hostInfo()
.
Compatibility
This method is available in deployments hosted in the following environments:
MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
Important
This command is not supported in M0, M2, and M5 clusters. For more information, see Unsupported Commands.
MongoDB Enterprise: The subscription-based, self-managed version of MongoDB
MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB