db.hostInfo()
Returns a document with information about the underlying system that the 返回一个文档,其中包含有关mongod or mongos runs on. mongod或mongos运行的底层系统的信息。Some of the returned fields are only included on some platforms.一些返回的字段仅包含在某些平台上。
db.hostInfo() provides a 围绕mongosh helper method around the hostInfo command. hostInfo命令提供了mongosh助手方法。The output of Linux系统上db.hostInfo() on a Linux system will resemble the following:db.hostInfo()的输出如下:
{
"system" : {
"currentTime" : ISODate("<timestamp>"),
"hostname" : "<hostname>",
"cpuAddrSize" : <number>,
"memSizeMB" : <number>,
"memLimitMB" : <number>, // Available starting in MongoDB 4.0.9 (and 3.6.13)
"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 of db.hostInfo().db.hostInfo()输出的完整文档,请参阅hostInfo。