kmongo / org.litote.kmongo / com.mongodb.client.MongoCollection / withDocumentClass

withDocumentClass

fun <reified NewTDocument : Any> MongoCollection<*>.withDocumentClass(): MongoCollection<NewTDocument> (source)

Create a new MongoCollection instance with a different default class to cast any documents returned from the database into..

Parameters

Return
a new MongoCollection instance with the different default class