> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# buildInfo (database command)

## Definition

The [`buildInfo`](https://www.mongodb.com/docs/manual/reference/command/buildInfo.md#mongodb-dbcommand-dbcmd.buildInfo) command returns a build summary for the current [`mongod`.](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod)

## Compatibility

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

- [MongoDB Atlas](https://www.mongodb.com/docs/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.](https://www.mongodb.com/docs/atlas/unsupported-commands/)

- [MongoDB Enterprise](https://www.mongodb.com/docs/manual/administration/install-enterprise.md#std-label-install-mdb-enterprise): The subscription-based, self-managed version of MongoDB

- [MongoDB Community](https://www.mongodb.com/docs/manual/administration/install-community.md#std-label-install-mdb-community-edition): The source-available, free-to-use, and self-managed version of MongoDB

## Syntax

The command has the following syntax:

```javascript
db.runCommand(
   {
     buildInfo: 1
   }
)
```

## Usage

In [`mongosh`](https://www.mongodb.com/docs/mongodb-shell.md#mongodb-binary-bin.mongosh), call [`buildInfo`](https://www.mongodb.com/docs/manual/reference/command/buildInfo.md#mongodb-dbcommand-dbcmd.buildInfo) in the following form:

```javascript
db.runCommand( { buildInfo: 1 } )
```

The output document of [`buildInfo`](https://www.mongodb.com/docs/manual/reference/command/buildInfo.md#mongodb-dbcommand-dbcmd.buildInfo) has the following form:

```javascript
{
  "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

The document returned by the [`buildInfo`](https://www.mongodb.com/docs/manual/reference/command/buildInfo.md#mongodb-dbcommand-dbcmd.buildInfo) command.

### Supported

These fields are stable and should provide consistent behavior.

The commit identifier that identifies the state of the code used to build the [`mongod`.](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod)

An array that conveys version information about the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance. See [`version`](https://www.mongodb.com/docs/manual/reference/command/buildInfo.md#mongodb-data-buildInfo.version) for a more readable version of this string.

A string that conveys version information about the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance. If you need to present version information to a human, this field is preferable to [`versionArray`.](https://www.mongodb.com/docs/manual/reference/command/buildInfo.md#mongodb-data-buildInfo.versionArray)

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

A list of [storage engines](https://www.mongodb.com/docs/manual/faq/storage.md#std-label-faq-storage) available to the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) server.

A string that reports the JavaScript engine used in the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) instance. By default, this is `mozjs`.

A number that reflects the target processor architecture of the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) binary.

A boolean. `true` when built with debugging options.

A number that reports the [Maximum BSON Document Size.](https://www.mongodb.com/docs/manual/reference/limits.md#mongodb-limit-BSON-Document-Size)

An embedded document describing the version of the TLS/SSL library that [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) was built with and is currently using.

A list of add-on modules that [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) was built with. Possible values currently include "enterprise" and "rocksdb".

### Unstable

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

The memory allocator that [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) 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](https://www.mongodb.com/docs/manual/release-notes/8.0.md#std-label-8.0-tcmalloc-upgrade) for more information.

An embedded document containing various debugging information about the [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) build environment.
