Haris Khan
05/11/2021, 2:51 AMinline fun <reified T : Any> MongoCollection<T>.replaceOne(
replacement: T,
options: ReplaceOptions = ReplaceOptions()
): UpdateResult = replaceOneById(KMongoUtil.extractId(replacement, T::class), replacement, options)
I want to create a wrapper around it like so :
inline fun <reified T : Any> insertOrReplaceOne(document: T) {
collection.replaceOneById
}
Collection is of type MongoCollection<T> ... but the extension function fails to be applicable for some reason (this is a function in a parameterized class if it matters (same type T)) aka
abstract class BaseMongoPlatformRepository<T : Any> { }