bsondump"/>
OPTIONS

bsondump

On this page

Synopsis

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

Important

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

Options

Changed in version 3.0.0: bsondump removed the --filter, --dbpath and the --noobjcheck options.

bsondump
bsondump
--help

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.)

--quiet

Runs the 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
--version

Returns the bsondump release number.

--objcheck

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.

Changed in version 2.4: MongoDB enables --objcheck by default, to prevent any client from inserting malformed or invalid BSON into a MongoDB database.

--type <=json|=debug>

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

--pretty

New in version 3.0.0.

Outputs documents in a pretty-printed format JSON.

<bsonFilename>

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

Use

By default, bsondump outputs data to standard output. To create corresponding JSON files, you will need to use the shell redirect. See the following command:

bsondump collection.bson > collection.json

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

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

Was this page helpful?

Yes No

Thank you for your feedback!

We're sorry! You can Report a Problem to help us improve this page.