class Redis
def zscan_each(key, **options, &block)
-
(Enumerator)
- an enumerator for all found scores and members
Parameters:
-
options
(Hash
) --
Other tags:
- Example: Retrieve all of the members/scores in a sorted set -
def zscan_each(key, **options, &block) return to_enum(:zscan_each, key, **options) unless block_given? cursor = 0 loop do cursor, values = zscan(key, cursor, **options) values.each(&block) break if cursor == "0" end end