Convert ENV to BSON

Turn ENV files into BSON. One BSON document with the same keys in order; a top-level list is wrapped under the key items and any other value under value.

Converted in an isolated sandbox on our serversDeleted after 24 hours

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

Your dotenv settings as one BSON document.Each key keeps its place and its type in a single binary file.

  1. What you get

    One BSON file that holds one document. The keys appear in the same order as in the ENV file.

    Integers, floats, booleans, null and text keep their types. Nested objects and lists keep their types too.

  2. How the data is arranged

    If the top level is a list, it is wrapped under the key items. Any other top-level value is wrapped under the key value. Either way, the result is a single document.

  3. What changes

    Dates stay text. They are not turned into BSON date values.

    Integers beyond the signed 64-bit range become floats, so they are stored as floating-point numbers instead of whole numbers.

  4. Going back

    To turn a BSON document into KEY=value lines again, use BSON to ENV. To see the other conversions for this format, open every BSON conversion.

ENV and BSON.What each format is.

The formats

From · ENV

Dotenv

KEY=value lines that hold environment variables for an app.

Extensions
.env
MIME type
text/x-env
Kind
Text and data
To · BSON

BSON

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

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

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

terminal
$ cv convert report.env report.bson
$ cv convert report.env report.bson

Questions.What people ask about ENV to BSON.

01OF 04

No. The document has the same keys in the same order as the input.

No. Dates stay text.

It is wrapped under the key items, so the output is still one document.

Integers beyond the signed 64-bit range become floats.

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