Reputation: 267010
I want to be able to page through the results of a set, especially if it has a few thousand items in it.
The smembers command seems to just return all the items in the set, is paging not supported?
https://redis.io/commands/smembers
Upvotes: 1
Views: 498
Reputation: 49942
Paging in a Set isn't supported as Sets are not ordered.
There are two alternatives:
a) continue using Sets and call on SSCAN
to iterate the members. Note the SCAN
family of commands guarantees, as this is like but not identical to paging.
b) switch to using Sorted Sets and call on ZRANGE
for full-blown paging.
Upvotes: 2