const [newCursor, keys] = await redis.scan(0, {match: "*"});

Arguments

cursor
number
The cursor, use 0 in the beginning and then use the returned cursor for subsequent calls.
options
Object
match
string
Glob-style pattern to filter by field names.
count
number
Number of fields to return per call.
type
string
Filter by type. For example string, hash, set, zset, list, stream.

Response

The new cursor and the keys. If the new cursor is 0 the iteration is complete.
const [newCursor, keys] = await redis.scan(0, {match: "*"});