withCodecRegistry

abstract fun withCodecRegistry(codecRegistry: CodecRegistry): MongoDatabase

Create a new MongoDatabase instance with a different codec registry.

Return

a new MongoDatabase instance with the different codec registry

Parameters

codecRegistry

the new org.bson.codecs.configuration.CodecRegistry for the database