db.hostInfo()

  • db.hostInfo()
  • Returns a document with information about the underlying systemthat the mongod or mongos runs on. Some of thereturned fields are only included on some platforms.

db.hostInfo() provides a helper in the mongoshell around the hostInfo The output ofdb.hostInfo() on a Linux system will resemble thefollowing:

  1. {
  2. "system" : {
  3. "currentTime" : ISODate("<timestamp>"),
  4. "hostname" : "<hostname>",
  5. "cpuAddrSize" : <number>,
  6. "memSizeMB" : <number>,
  7. "memLimitMB" : <number>, // Available starting in MongoDB 4.0.9 (and 3.6.13)
  8. "numCores" : <number>,
  9. "cpuArch" : "<identifier>",
  10. "numaEnabled" : <boolean>
  11. },
  12. "os" : {
  13. "type" : "<string>",
  14. "name" : "<string>",
  15. "version" : "<string>"
  16. },
  17. "extra" : {
  18. "versionString" : "<string>",
  19. "libcVersion" : "<string>",
  20. "kernelVersion" : "<string>",
  21. "cpuFrequencyMHz" : "<string>",
  22. "cpuFeatures" : "<string>",
  23. "pageSize" : <number>,
  24. "numPages" : <number>,
  25. "maxOpenFiles" : <number>
  26. },
  27. "ok" : <return>
  28. }

See hostInfo for full documentation of the output ofdb.hostInfo().