findCodecForType
Returns the instance of Codec (from the official MongoDB driver) that is used to encode or decode the given type.
If type and T do not match, the behavior is unspecified. Prefer using the no-argument of this method.
See also
The codec registry used by this BSON factory.
Throws
If no matching codec is found for the given type.
Returns the instance of Codec (from the official MongoDB driver) that is used to encode or decode the given type T.
Example
val client = MongoClient.create("mongodb://mongo:27017")
val factory = BsonFactory(client.codecRegistry)
val codec = factory.findCodecForType<String>()Content copied to clipboard
See also
The codec registry used by this BSON factory.
Throws
If no matching codec is found for the given type.