db.hostInfo() in mongoDB

hostInfo()

This method returns a document with information about the underlying system that the mongod or mongos runs on.

Note:

Some of the returned fields are only included on some platforms.


Syntax:

db.hostInfo() 


Example

MongoDB

db.hostInfo()

Output:

{
    "system" : {
            "currentTime" : ISODate("2022-06-26T06:38:06.544Z"),
            "hostname" : "DESKTOP-OK73JMQ",
            "cpuAddrSize" : 64,
            "memSizeMB" : NumberLong(5878),
            "memLimitMB" : NumberLong(5878),
            "numCores" : 4,
            "cpuArch" : "x86_64",
            "numaEnabled" : false
    },
    "os" : {
            "type" : "Windows",
            "name" : "Microsoft Windows 10",
            "version" : "10.0 (build 19044)"
    },
    "extra" : {
            "pageSize" : NumberLong(4096),
            "physicalCores" : 2
    },
    "ok" : 1
}


No comments:

Post a Comment