OPTIONS
翻译或纠错本页面

db.hostInfo()

db.hostInfo()

2.2 新版功能.

返回:A document with information about the underlying system that the mongod or mongos runs on. Some of the returned fields are only included on some platforms.

db.hostInfo() provides a helper in the mongo shell around the hostInfo The output of db.hostInfo() on a Linux system will resemble the following:

{
   "system" : {
          "currentTime" : ISODate("<timestamp>"),
          "hostname" : "<hostname>",
          "cpuAddrSize" : <number>,
          "memSizeMB" : <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 of db.hostInfo().

←   db.help() db.isMaster()  →
ON THIS PAGE