BsonConfiguration

data class BsonConfiguration(val encodeDefaults: Boolean = true, val explicitNulls: Boolean = false, val classDiscriminator: String = "_t")

Bson Configuration for serialization

Usage example with codecs:

val codec = KotlinSerializerCodec.create(mykClass, bsonConfiguration = BsonConfiguration(encodeDefaults = false))

Constructors

Link copied to clipboard
constructor(encodeDefaults: Boolean = true, explicitNulls: Boolean = false, classDiscriminator: String = "_t")

Properties

Link copied to clipboard

class discriminator to use when encoding polymorphic types

Link copied to clipboard

encode default values, defaults to true

Link copied to clipboard
val explicitNulls: Boolean = false

encode null values, defaults to false