Convert JSON to BSON
Turn JSON 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 JSON files on the dialor turn it to pick what to do
JSON becomes one BSON document.Keys stay in order, and value types are kept.
What you get
One BSON document with the same keys in the same order as the JSON. Integers, floats, booleans, null, text, nested objects and lists keep their types.
The conversion produces one file.
What gets wrapped or changed
BSON needs a document at the top. A top-level list is wrapped under the key items, and any other top-level value is wrapped under the key value.
Dates stay text. A date in the JSON is not turned into a BSON date.
Integers beyond the signed 64-bit range become floats.
When it fails
If the file cannot be parsed, the conversion stops with
input_corrupted. The JSON has to be readable before a document can be built.
JSON and BSON.What each format is.
The formats
JSON
JSON, the data format of every API.
- Extensions
- .json
- MIME type
- application
/json - Kind
- Text and data
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 JSON to BSON conversion through the API, for your app or your agent.
$ cv convert report.json report.bson$ cv convert report.json report.bsonQuestions.What people ask about JSON to BSON.
Yes. The list is wrapped under the key items in a single BSON document.
No. Dates stay text, as they are in the JSON.
Integers beyond the signed 64-bit range become floats. Integers within that range stay integers.
Use BSON to JSON to convert the document back.