const [newCursor, keys] = await redis.scan(0, {match: "*"});
Scan the database for keys.
The cursor, use 0 in the beginning and then use the returned cursor for subsequent calls.
0
Glob-style pattern to filter by field names.
Number of fields to return per call.
Filter by type. For example string, hash, set, zset, list, stream.
string
hash
set
zset
list
stream
The new cursor and the keys. If the new cursor is 0 the iteration is complete.
Was this page helpful?