14.07.2013 Views

Essentials of Javascript - Cultural View

Essentials of Javascript - Cultural View

Essentials of Javascript - Cultural View

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BSON 59<br />

BSON<br />

Filename<br />

extension<br />

.bson<br />

Type <strong>of</strong> format Data<br />

interchange<br />

BSON (pronounced /ˈbiːsɒn/) is a computer data interchange format. It is a binary form for representing simple data<br />

structures and associative arrays (called objects or documents). The name "BSON" is based on the term JSON and<br />

informally means "Binary JSON".<br />

Data types and syntax<br />

BSON documents (objects) consist <strong>of</strong> a well ordered list <strong>of</strong> elements. Each element consists <strong>of</strong> a field name, a type,<br />

and a value. Field names are strings. Types include:<br />

• string<br />

• integer<br />

• double<br />

• date<br />

• byte array (binary data)<br />

• boolean (true and false)<br />

• null<br />

• BSON object<br />

This is nominally a superset <strong>of</strong> JSON types (JSON does not have a byte array type, for example), but because <strong>of</strong><br />

length limitations, some valid JSON values (such as very long strings) are not valid BSON values.<br />

Efficiency<br />

Compared to JSON, BSON is efficient both in storage space and scan-speed. Large elements in a BSON document<br />

are prefixed with a length field to facilitate scanning.<br />

See also<br />

• JSON<br />

• Protocol Buffers<br />

• Document-oriented database<br />

External links<br />

• BSON Specification [1]<br />

References<br />

[1] http://bsonspec.org

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!