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
:count => Integer
Returns:
the next cursor and all found keys
2297 2298 2299
# File 'lib/redis.rb', line 2297 def scan(cursor, options={}) _scan(:scan, cursor, [], options) end