Set

SSCAN

Scan a set

Arguments

keybodystrrequired

The key of the set.

cursorbodynumber

The cursor, use 0 in the beginning and then use the returned cursor for subsequent calls.

optionsbodyObject
matchbodystr

Glob-style pattern to filter by members.

countbodynumber

Number of members to return per call.

Response

Tuple[number, TMember[]]required

The new cursor and the members. If the new cursor is 0 the iteration is complete.

Example
# Get all members of a set.cursor = 0results = set()while True:    cursor, keys = redis.sscan("myset", cursor, match="*")    results.extend(keys)    if cursor == 0:        break
Loading search…