Skip to content

Kotlin BSON • Pure Kotlin Multiplatform implementationopensavvy.ktmongo.bson.multiplatformBson

Bson

class Bson : Bson

Pure Kotlin BSON document implementation.

Implementation

Instead of decoding the BSON document into subdocuments, this class stores the raw bytes in BSON representation. Fields are decoded lazily when searched via the reader.

Because the reader is lazy, it is not thread-safe. If you want to use this instance without external synchronization, call eager.

Functions

eager

fun eager()

Scans this entire document recursively to find all the fields.

equals

open operator override fun equals(other: Any?): Boolean

hashCode

open override fun hashCode(): Int

reader

@LowLevelApi
open override fun reader(): BsonDocumentReader

toByteArray

@LowLevelApi
open override fun toByteArray(): ByteArray

toString

open override fun toString(): String