If you’re getting an error that reads “ERR wrong number of arguments for ‘srandmember’ command” in Redis, it’s probably because you’re calling the SRANDMEMBER
command without any arguments.
To fix this issue, make sure you pass the correct number of arguments. At the time of writing, the SRANDMEMBER
command requires at least one argument, and accepts an optional second argument.