db.hostInfo()
db.hostInfo()
返回一个文档,其中包含有关运行
mongod
或mongos
的根本的系统的信息。 某些返回的字段仅包含在某些平台上。db.hostInfo()
围绕 命令提供mongosh
hostInfo
辅助方法。Linux 系统上db.hostInfo()
的输出将类似于以下内容:{ "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> }