Skip to main content

Binary document format

Keep document semantics in a binary envelope.

BSON stores JSON-like documents with binary encodings for values such as dates, integers, and byte arrays. The module exposes a focused load/write path while keeping the result familiar to JavaScript applications.

Document data path

Use a binary document without changing the application model.

BSON is useful when a document needs typed binary values or compact transport. loaders.gl decodes it into JSON-like objects and writes compatible objects back to the binary format.

Read

Decode BSON elements into JSON-like JavaScript values.

Types

Preserve format-specific binary, numeric, and date values.

Use

Pass the document to ordinary application logic.

Write

Encode JSON-like values as BSON binary documents.

Detailed guide

BSON format and API details

The reference below lists the document shape, supported value types, loader options, and writer behavior.

Loaders and Writers​

CharacteristicValue
File FormatBSON
Data FormatUnstructured/JSON
File TypeBinary
File Extension.bson
MIME Typesapplication/bson