# Get all members of a hash.cursor = 0results = []while True: cursor, keys = redis.hscan("myhash", cursor, match="*") results.extend(keys) if cursor == 0: break
Hash
HSCAN
Scan a hash for fields.
Copy
Ask AI
# Get all members of a hash.cursor = 0results = []while True: cursor, keys = redis.hscan("myhash", cursor, match="*") results.extend(keys) if cursor == 0: break
The new cursor and the fields.
If the new cursor is 0 the iteration is complete.
Copy
Ask AI
# Get all members of a hash.cursor = 0results = []while True: cursor, keys = redis.hscan("myhash", cursor, match="*") results.extend(keys) if cursor == 0: break