This version of the documentation is archived and no longer supported.


macOS Sierra and Go 1.6 Incompatibility

Users running on macOS Sierra require the 3.2.10 or newer version of bsondump.

Upcoming Tools Migration in MongoDB 4.4

Starting in MongoDB 4.4, the bsondump documentation migrates to MongoDB Database Tools - bsondump. Refer to that page for more information on the upcoming version of bsondump (tool version 100.0.0).

The documentation on this page only applies to the MongoDB 4.2 version of bsondump. The MongoDB 4.2 version of bsondump is available for download following the instructions in the Availability section below.


The bsondump converts BSON files into human-readable formats, including JSON. For example, bsondump is useful for reading the output files generated by mongodump.

Run bsondump from the system command line, not the mongo shell.


bsondump is a diagnostic tool for inspecting BSON files, not a tool for data ingestion or other application use.

Starting in version 4.2, bsondump uses Extended JSON v2.0 (Canonical mode) to format its data.


The bsondump tool is part of the MongoDB tools package. Consult the installation guide for your platform for instructions on how to install the tools package as part of your MongoDB installation.

The tools package is also available from the MongoDB Download Center, either as a separate tools download, or contained within the TGZ or ZIP downloads, depending on platform. On Windows, the MSI installer includes all tools as part of the default installation.


If downloading the TGZ or ZIP files from the Download Center, you may want to update your PATH environment variable to include the directory where you installed these tools. See the installation guide for your platform for more information.



Returns information on the options and use of bsondump.

--verbose, -v

Increases the amount of internal reporting returned on standard output or in log files. Increase the verbosity with the -v form by including the option multiple times, (e.g. -vvvvv.)


Runs bsondump in a quiet mode that attempts to limit the amount of output.

This option suppresses:

  • output from database commands
  • replication activity
  • connection accepted events
  • connection closed events

Returns the bsondump release number.


Validates each BSON object before outputting it in JSON format. By default, bsondump enables --objcheck. For objects with a high degree of sub-document nesting, --objcheck can have a small impact on performance.


Changes the operation of bsondump from outputting “JSON” (the default) to a debugging format.


Outputs documents in a pretty-printed format JSON.


New in version 3.4.

Specifies a path to a BSON file to dump to JSON. --bsonFile is an alternative to the positional <bsonFilename> option.

By default, bsondump reads from standard input.


The final argument to bsondump is a document containing BSON. This data is typically generated by bsondump or by MongoDB in a rollback operation.


New in version 3.4.

Specifies the path of the file to which bsondump should write its output JSON data.

By default, bsondump writes to standard output.


Changed in version 3.4.

By default, bsondump outputs data to standard output. To create corresponding JSON files, you can use the --outFile option:

bsondump --outFile=collection.json collection.bson

Use the following command (at the system shell) to produce debugging output for a BSON file:

bsondump --type=debug collection.bson
←   mongorestore mongoimport  →