decodeFromBsonValue

inline fun <T : Any> EJson.decodeFromBsonValue(value: BsonValue): T

Deserializes the given value element into a value of type T using a deserializer retrieved from reified type parameter.

Throws

kotlinx.serialization.SerializationException

if the given BsonValue element is not a valid BSON input for the type T

if the decoded input cannot be represented as a valid instance of type T