定义
兼容性
此命令可用于以下环境中托管的部署:
- MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud
注意
This command is supported in all MongoDB Atlas clusters. For information on Atlas support for all commands, see Unsupported Commands.
MongoDB Enterprise:基于订阅、自我管理的 MongoDB 版本
MongoDB Community:源代码可用、免费使用且可自行管理的 MongoDB 版本
语法
该命令具有以下语法:
db.runCommand( { buildInfo: 1 } )
使用
In mongosh, call buildInfo in the following form:
db.runCommand( { buildInfo: 1 } )
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> }
输出
buildInfoThe document returned by the
buildInfocommand.
受支持
这些字段是稳定的,应提供一致的行为。
buildInfo.gitVersion提交标识符,用于标识用于构建
mongod的代码的状态。
buildInfo.versionArrayAn array that conveys version information about the
mongodinstance. Seeversionfor a more readable version of this string.
buildInfo.versionA string that conveys version information about the
mongodinstance. If you need to present version information to a human, this field is preferable toversionArray.对于发布版本,此字符串将采用
<major>.<minor>.<patch>格式,但开发版本可能包含其他信息。
buildInfo.storageEngines此字段仅列出引擎名称。要获取WiredTiger版本,请参阅
serverStatus输出中的wiredTiger.version。
buildInfo.javascriptEnginestring报告JavaScript 实例中使用的
mongod引擎的 。默认为mozjs。
buildInfo.bits一个反映
mongod二进制文件的目标处理器架构的数字。
buildInfo.openssl一个嵌入式文档,描述构建
mongod时使用的以及当前正在使用的 TLS/SSL 库的版本。
buildInfo.modules构建
mongod所使用的附加模块列表。 目前可能的值包括“enterprise”和“Rocksdb”。
不稳定
这些字段仅供内部使用,您不应期望它们的行为或存在在任何级别上都保持一致。
buildInfo.allocatormongod使用的内存分配器。 默认为tcmalloc。注意
从 8.0 版开始,MongoDB 使用 TCMalloc 的更新版本,改进了内存碎片和管理。如需了解更多信息,请参阅 tcmalloc 升级。
buildInfo.buildEnvironment嵌入式文档,其中包含有关
mongod构建环境的各种调试信息。