MongoKacheController
class MongoKacheController(cacheEnabled: () -> Boolean = { true }, cache: CacheClient, asyncWriteScope: CoroutineScope? = null, onAsyncWriteError: (Throwable) -> Unit = {}) : KacheController
MongoDB adapter providing a typed public API over KacheController.
Each method delegates to KacheController's internal helpers, deriving cache keys from the database and collection names in the MongoCollection namespace.
Constructors
Link copied to clipboard
constructor(cacheEnabled: () -> Boolean = { true }, cache: CacheClient, asyncWriteScope: CoroutineScope? = null, onAsyncWriteError: (Throwable) -> Unit = {})
Functions
Link copied to clipboard
Link copied to clipboard
suspend fun <T : Model> setAll(collection: MongoCollection<T>, serializer: KSerializer<T>, expire: Duration? = null, fieldExpire: Duration? = null, invalidateVolatiles: Boolean = true, maxCacheSize: Int? = null, cacheKey: String = collection.cacheKey(), setData: suspend MongoCollection<T>.() -> List<T>?): Boolean