Convert JSONL to BSON

Turn JSONL 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 JSONL files on the dialor turn it to pick what to do

JSON Lines in, one BSON document out.The keys stay in order, and the types you can see in the JSON carry over.

  1. What you get

    One BSON file with one document in it. Integers, floats, booleans, null, text, nested objects and lists keep their types. Keys keep the order they have in the input.

    BSON is MongoDB's binary document encoding. It is JSON with dates and binary fields.

  2. How the lines are wrapped

    A top-level list is wrapped under the key items. Any other value is wrapped under the key value.

    Dates stay text. They are not turned into BSON dates.

  3. Large integers

    Integers beyond the signed 64-bit range become floats. Integers inside that range stay integers.

  4. When it fails

    If the file cannot be parsed, the conversion stops with input_corrupted.

    To go the other way, use BSON to JSONL. To join several files before you convert, try merge JSONL.

JSONL and BSON.What each format is.

The formats

From · JSONL

JSON Lines

JSON Lines, one JSON object per line, the format of logs and datasets.

Extensions
.jsonl .ndjson
MIME type
application/jsonl
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 JSONL to BSON conversion through the API, for your app or your agent.

terminal
$ cv convert report.jsonl report.bson
$ cv convert report.jsonl report.bson

Questions.What people ask about JSONL to BSON.

01OF 04

It makes one file. The result is a single BSON document.

No. Dates stay text.

Integers beyond the signed 64-bit range become floats. All other integers keep their type.

The file could not be parsed, and the conversion stops with input_corrupted.

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