common Kotlin BSON • Multiplatform abstraction for different BSON implementations • opensavvy.ktmongo.bson • write write¶ inline fun <T : Any> BsonContext.write(obj: T): Bson Writes an arbitrary Kotlin obj into a top-level BSON document. A top-level BSON document cannot be null, cannot be a primitive, and cannot be a collection. If obj is not representable as a document, an exception is thrown. See also¶ read The inverse operation.