Scan the keyspace
Retrieve the first batch of keys
redis.scan(0) # => ["4", ["key:21", "key:47", "key:42"]]
Retrieve a batch of keys matching a pattern
redis.scan(4, :match => "key:1?") # => ["92", ["key:13", "key:18"]]
Parameters:
the cursor of the iteration
‘:match => String`: only return keys matching the pattern
‘:count => Integer`: return count keys at most per iteration
Returns:
the next cursor and all found keys
2666 2667 2668
# File 'lib/redis.rb', line 2666 def scan(cursor, **options) _scan(:scan, cursor, [], **options) end