Convert BSON to TOML

Turn BSON files into TOML. The same keys and values as TOML, with plain values written before tables, and a top-level list is written under the key items, as [[items]] tables when its entries are objects.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop BSON files on the dialor turn it to pick what to do

BSON documents as a TOML config file.Keys and values carry over. Dates, ObjectIds and binary data become text.

  1. What you get

    One TOML file with the same keys and values as the BSON document. Plain values are written before tables, as TOML expects.

    A top-level list is written under the key items. When its entries are objects, each one becomes an [[items]] table.

  2. How types change

    TOML has no types for these BSON values, so they are written as text. ObjectIds become hex text, dates become ISO 8601 text and binary data becomes base64.

  3. What stops or drops

    A null in an object is dropped, and the conversion gives a warning. A null inside a list fails, because TOML can hold neither. An integer beyond the signed 64-bit range fails for the same reason.

    The conversion stops with unsupported_elements when the file holds something TOML cannot carry, or when some inputs cannot become the format the join takes. It stops with input_corrupted when the file could not be parsed.

    To go the other way, use TOML to BSON.

BSON and TOML.What each format is.

The formats

From · BSON

BSON

MongoDB's binary document encoding, JSON with dates and binary fields.

Extensions
.bson
MIME type
application/bson
Kind
Text and data
To · TOML

TOML

TOML configuration files, the format of Cargo and pyproject.

Extensions
.toml
MIME type
application/toml
Kind
Text and data

In your code.The same BSON to TOML conversion through the API, for your app or your agent.

terminal
$ cv convert report.bson report.toml
$ cv convert report.bson report.toml

Questions.What people ask about BSON to TOML.

01OF 04

ObjectIds become hex text. Dates become ISO 8601 text.

Binary data becomes base64 text in the TOML file.

A null in an object is dropped with a warning, because TOML has no null. A null inside a list fails instead.

It goes under the key items. If its entries are objects, they are written as [[items]] tables.

More conversions.Other ways in and out of BSON and TOML.