|
SrandmemberCommand
We moved to Redis.io!Redis home moved to http://redis.io, please visit our new home. |
► Sign in to add a comment
|
Search
|
|
SrandmemberCommand
We moved to Redis.io!Redis home moved to http://redis.io, please visit our new home. |
It would be cool if this could take an optional integer parameter with the number of random items. If you said SRANDMEMBER foo 2, it would give you two distinct random elements from the set.
I also think SRANDMEMBER should receive the number of results. If I need 200 results (a real use case, by the way), it is wasteful to send 200 SRANDMEMBER commands.
+1 on making SRANDMEMBER accept an parameter specifying the number of members to return. It might be an idea to delegate this to a SRANDMEMBERS command for clarity.