Skip to content

Kotlin BSON • Pure Kotlin Multiplatform implementationopensavvy.ktmongo.bson.multiplatform.serializationencodeToBson

encodeToBson

Encodes an arbitrary value into a Bson document.

value must be serializable using KotlinX.Serialization. For example, using the @Serializable annotation.

@ExperimentalSerializationApi
inline fun <T : Any> encodeToBson(context: BsonContext, value: T): Bson

Encodes an arbitrary value into a Bson document.

value must be serializable using KotlinX.Serialization. For example, using the @Serializable annotation.