BsonContext

Configuration for the BSON serialization.

Instances of this class are platform-specific and are used to create BSON documents. Platforms can thus parameterize the behavior of writers and readers.

For example, a platform may store its serialization configuration in this class.

Functions

Link copied to clipboard

Instantiates a new BSON array.

Instantiates a new BSON array representing the provided instance.

Link copied to clipboard
abstract fun buildDocument(block: BsonFieldWriter.() -> Unit): Bson

Instantiates a new BSON document.

Instantiates a new BSON document representing the provided instance.

Link copied to clipboard

Creates a new instance of an ObjectId.

Link copied to clipboard

Instantiates a new BSON array by reading its bytes representation.

Link copied to clipboard
abstract fun readDocument(bytes: ByteArray): Bson

Instantiates a new BSON document by reading its bytes representation.