Convert CSV to BSON

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

A CSV table as one BSON document.The keys keep their order, and numbers, booleans and null keep their types.

  1. What you get

    One BSON file holding one document. The keys come out in the same order as in the CSV, and a top-level list is wrapped under the key items. Any other value is wrapped under the key value.

    Integers, floats, booleans, null, text, nested objects and nested lists keep their types in the document.

  2. What changes

    Dates stay text. BSON has a date type, but the conversion does not turn date values into it.

    Integers beyond the signed 64-bit range become floats.

  3. Setting the delimiter

    When Delimiter is left out, it is guessed from the rows. Set Delimiter to comma, semicolon, tab or pipe if the guess is wrong. Spreadsheets in many European locales use semicolons.

    To go the other way, use BSON to CSV.

CSV and BSON.What each format is, and the options this conversion takes.

  1. 01 · delimiter

    Delimiter

    The character between fields. It is guessed from the rows when left out. Spreadsheets in many European locales use semicolons.

    • comma A comma.
    • semicolon A semicolon.
    • tab A tab.
    • pipe A vertical bar.
    comma · semicolon · tab · pipe

The formats

From · CSV

CSV

Rows of comma-separated values. The plainest way to move a table between programs.

Extensions
.csv
MIME type
text/csv
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 CSV to BSON conversion through the API, for your app or your agent.

terminal
$ cv convert sheet.csv sheet.bson
$ cv convert sheet.csv sheet.bson

Questions.What people ask about CSV to BSON.

01OF 04

One document, in one file. A top-level list is wrapped under the key items.

No. Dates stay text.

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

It guesses from the rows when Delimiter is left out. Set Delimiter to comma, semicolon, tab or pipe to choose one yourself.

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