Database Manual / Reference / Database Commands / Diagnostics

buildInfo (database command数据库命令)

Definition定义

buildInfo
The buildInfo command returns a build summary for the current mongod.buildInfo命令返回当前mongod的构建摘要。

Compatibility兼容性

This command is available in deployments hosted in the following environments:此命令在以下环境中托管的部署中可用:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud:云中MongoDB部署的完全托管服务

Note

This command is supported in all MongoDB Atlas clusters. 所有MongoDB Atlas集群都支持此命令。For information on Atlas support for all commands, see Unsupported Commands.有关Atlas支持所有命令的信息,请参阅不支持的命令

  • MongoDB Enterprise: The subscription-based, self-managed version of MongoDB:MongoDB的基于订阅的自我管理版本
  • MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB:MongoDB的源代码可用、免费使用和自我管理版本

Syntax语法

The command has the following syntax:该命令具有以下语法:

db.runCommand(
{
buildInfo: 1
}
)

Usage用法

In mongosh, call buildInfo in the following form:mongosh中,按以下形式调用buildInfo

db.runCommand( { buildInfo: 1 } )

The output document of buildInfo has the following form:buildInfo的输出文档具有以下形式:

{
"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>
}

Output输出

buildInfo
The document returned by the buildInfo command.buildInfo命令返回的文档。

Supported支持

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 mongod.标识用于构建mongod的代码状态的提交标识符。
buildInfo.versionArray
An array that conveys version information about the mongod instance. See version for a more readable version of this string.一个数组,用于传达mongod实例的版本信息。有关此字符串的更易读版本,请参阅version
buildInfo.version

A string that conveys version information about the mongod instance. If you need to present version information to a human, this field is preferable to versionArray.一个字符串,用于传达mongod实例的版本信息。如果你需要向人展示版本信息,这个字段比versionArray更可取。

This string will take the format <major>.<minor>.<patch> in the case of a release, but development builds may contain additional information.此字符串将在发布的情况下采用<major>.<minor>.<patch>格式,但开发版本可能包含其他信息。

buildInfo.storageEngines
A list of storage engines available to the mongod server.mongod服务器可用的存储引擎列表。
buildInfo.javascriptEngine
A string that reports the JavaScript engine used in the mongod instance. By default, this is mozjs.一个字符串,用于报告mongod实例中使用的JavaScript引擎。默认情况下,这是mozjs
buildInfo.bits
A number that reflects the target processor architecture of the mongod binary.一个反映mongod二进制文件的目标处理器架构的数字。
buildInfo.debug
A boolean. true when built with debugging options.布尔值。当使用调试选项构建时为true
buildInfo.maxBsonObjectSize
A number that reports the Maximum BSON Document Size.报告最大BSON文档大小的数字。
buildInfo.openssl
An embedded document describing the version of the TLS/SSL library that mongod was built with and is currently using.一个嵌入式文档,描述了mongod构建和当前使用的TLS/SSL库的版本。
buildInfo.modules
A list of add-on modules that mongod was built with. Possible values currently include "enterprise" and "rocksdb".mongod构建时使用的附加模块列表。目前可能的值包括“企业”和“rocksdb”。

Unstable不稳定

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 mongod uses. By default this is tcmalloc.mongod使用的内存分配器。默认情况下,这是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.从8.0版本开始,MongoDB使用TCMalloc的更新版本,改进了内存分片和管理。有关更多信息,请参阅tcmalloc升级

buildInfo.buildEnvironment
An embedded document containing various debugging information about the mongod build environment.一个嵌入式文档,包含有关mongod构建环境的各种调试信息。