withCodecRegistry

abstract fun withCodecRegistry(codecRegistry: CodecRegistry): MongoCollection<TDocument>

Create a new MongoCollection instance with a different codec registry.

Return

a new MongoCollection instance with the different codec registry

Parameters

codecRegistry

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