scanKeys

fun UnifiedJedis.scanKeys(pattern: String, count: Int = 100): Sequence<String>

Lazily scans Redis keys matching the given pattern using the SCAN command.

Extension function on UnifiedJedis. Returns a Sequence that iterates through all matching keys without loading them all into memory at once.

Return

a Sequence of matching key names

Parameters

pattern

the glob-style pattern to match keys against (e.g., "user:*")

count

a hint to Redis for how many keys to return per SCAN iteration