



What is BSON? BSON features? BSON Data Types? BSON Helpful Tools?

JSON BSON Description



{"hello": "bson"}



\x02 \x16\x00\x00\x00\x02

\x06\x00\x00\x00bson\x00 hello\x00\x06\x00\x00\x00bson\x00 \x00 total document size

field name 0x02 = type Stringfield name field value 0x00 = type EOO ('end of object')



BSON main features:

BSON Data types

BSON Helpful Tools





BSON is a short form of “Binary JSON”. Its combination of “B” From “Binary” and “SON” from “JSON” =BSON. It’s a Binary-encode serialization of JSON Document. It is a data interchange format mainly famous for data storage and transfer format in the MongoDB database. It is a binary form of objects and data structures.BSON supports embedding documents, array, and objects with in other documents. Means one objects can have more objects. BSON is also designed to be fast to encode and decode.BSON strong type and it support more Data Types then JSON. BSON element consists of a fields name, type and value. Fields names are strings.BSON is designed for storage space and high speed scanning. Large elements in a BSON document are prefixed with a length field to facilitate scanning. In some cases, BSON will use more space than JSON due to the length prefixes and explicit array indices.Lightweight – Its design for minimum important for any data representation format, especially when used over the net­work.Traversable - BSON is designed to be traversed easily.Efficient – Due to C data types it’s very fast in Encoding data to BSON and decoding from BSON.stringinteger (32- or 64-bit)double (64-bit IEEE 754 floating point number)date (integer number of milliseconds since the Unix epoch)byte array (binary data)boolean (true and false)nullBSON objectBSON array