BSON
An umbrella module providing a BSON parser, encoder, and decoder.
import BSONModule information
- Declarations
- 29
- Symbols
- 77
Tutorials
BSON Usage Examples
Using BSON in production generally consists of three kinds of tasks: defining root types that model the documents you want to store as BSON, defining reusable supporting types to model fields in other types, and actually encoding and decoding BSON documents to and from binary data.
Read MoreBSON Decoding and Encoding, Explained
This article walks through the process of implementing
Read MoreBSONDocumentDecodableandBSONDocumentEncodableconformances for a model type in detail, and explains the rationale behind library’s design decisions.Advanced Serialization Patterns
Level up your BSON encoding skills by learning these composable serialiation patterns. Internalizing these techniques will help you write more efficient and maintainable database applications by avoiding temporary allocations and reusing generic library code.
Read MoreTextures and Coordinates
BSON documents can embed arbitrary binary data. This is useful for storing trivial repeating values like RGB colors or 3D coordinates, and can save an enormous amount of keying overhead, though at the cost of making the data un-queryable, as the database will not understand your custom data format.
Read More
Linking the BSON libraries
This module re-exports the BSONABI, BSONEncoding, BSONDecoding, and BSONArrays modules. Importing them directly is discouraged.
Some BSON modules (currently BSONLegacy and BSONReflection) are considered ancillary and are not included in this umbrella module.