SRANDMEMBERReturn one or more random members of a set without removing them. A negative count allows repeats.
| Syntax | SRANDMEMBER key [count] |
| Group | set |
| Arity | -2 |
| Since | 1.0.0 |
| Flags | readonly |
| Complexity | O(count) expected when count is a small fraction of the set (random-slot probing); O(N) once count exceeds a quarter of it, where copying and shuffling beats rejection sampling |
| Redis compatibility | full |