MongoDB.local SF, Jan 15: See the speaker lineup & ship your AI vision faster. Use WEB50 to save 50%
Find out more >
Docs Menu
Docs Home
/ /

buildInfo (database command)

buildInfo

The buildInfo command returns a build summary for the current MongoDB instance (mongod or mongos).

This command is available in deployments hosted in the following environments:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

Note

This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.

The command has the following syntax:

db.runCommand(
{
buildInfo: 1
}
)

In mongosh, call buildInfo in the following form:

db.runCommand( { buildInfo: 1 } )

You can run this command on both mongod and mongos instances.

The output document of buildInfo has the following form:

{
"version" : "<string>",
"gitVersion" : "<string>",
"sysInfo" : "<string>",
"loaderFlags" : "<string>",
"compilerFlags" : "<string>",
"allocator" : "<string>",
"versionArray" : [ <num>, <num>, <...> ],
"openssl" : <document>,
"javascriptEngine" : "<string>",
"bits" : <num>,
"debug" : <boolean>,
"maxBsonObjectSize" : <num>,
"storageEngines" : [ "<string>", "<string>", "<...>" ],
"ok" : <num>
}
buildInfo

The document returned by the buildInfo command.

These fields are stable and should provide consistent behavior.

buildInfo.gitVersion

The commit identifier that identifies the state of the code used to build the MongoDB instance.

buildInfo.versionArray

An array that conveys version information about the MongoDB instance. See version for a more readable version of this string.

buildInfo.version

A string that conveys version information about the MongoDB instance. If you need to present version information to a human, this field is preferable to versionArray.

This string will take the format <major>.<minor>.<patch> in the case of a release, but development builds may contain additional information.

buildInfo.storageEngines

A list of storage engines available to the MongoDB server.

buildInfo.javascriptEngine

A string that reports the JavaScript engine used in the MongoDB instance. By default, this is mozjs.

buildInfo.bits

A number that reflects the target processor architecture of the MongoDB binary.

buildInfo.debug

A boolean. true when built with debugging options.

buildInfo.maxBsonObjectSize

A number that reports the Maximum BSON Document Size.

buildInfo.openssl

An embedded document describing the version of the TLS/SSL library that the MongoDB instance was built with and is currently using.

buildInfo.modules

A list of add-on modules that the MongoDB instance was built with. Possible values currently include "enterprise" and "rocksdb".

These fields are for internal use only, and you should not expect their behavior or existence to remain consistent on any level.

buildInfo.allocator

The memory allocator that the MongoDB instance uses. By default this is tcmalloc.

Note

Starting in version 8.0, MongoDB uses an updated version of TCMalloc that improves memory fragmentation and management. See tcmalloc upgrade for more information.

buildInfo.buildEnvironment

An embedded document containing various debugging information about the MongoDB build environment.

Back

Diagnostics

On this page