Method: Redis::Commands::SortedSets#zscan

Defined in:
lib/redis/commands/sorted_sets.rb

#zscan(key, cursor, **options) ⇒ String, Array<[String, Float]>

Scan a sorted set

See the Redis Server ZSCAN documentation for further details

Examples:

Retrieve the first batch of key/value pairs in a hash

redis.zscan("zset", 0)

Parameters:

  • cursor (String, Integer)

    the cursor of the iteration

  • options (Hash)
    • :match => String: only return keys matching the pattern
    • :count => Integer: return count keys at most per iteration

Returns:

  • (String, Array<[String, Float]>)

    the next cursor and all found members and scores



856
857
858
859
860
# File 'lib/redis/commands/sorted_sets.rb', line 856

def zscan(key, cursor, **options)
  _scan(:zscan, cursor, [key], **options) do |reply|
    [reply[0], FloatifyPairs.call(reply[1])]
  end
end