Hi, I'm trying to set expiration date on field in my database with kmongo-coroutine driver. My goal is when date is expired whole entry should be removed rom mongo db. But idk how to make it work.
Copy code
override suspend fun setTokenInvalid(refreshToken: String):Boolean {
collection.createIndex(RefreshToken::refreshToken, IndexOptions().expireAfter(7, TimeUnit.DAYS))
}
Mateusz Kolbusz
04/08/2023, 9:13 PM
I've found solution but in my opinion there is a better solution without using string.