Maybe something like… ```val currentIndexName = in...
# getting-started
d
Maybe something like…
Copy code
val currentIndexName = indexToAliasMappings.filter {
    val (index, aliasMappings) = it
    aliasMappings.get("aliases")?.containsKey(alias) ?: false
}.lastOrNull() ?: “”
will do the same thing as what you have. (haven’t tested).
val evens = listOf(1, 2, 3, 4).filter{ it % 2 == 0 }
is a simple example of using filter,
evens
will be a list with the values
2, 4