If you’re getting an error that reads “ERR syntax error” when calling the SRANDMEMBER
command in Redis, it could be that you’re passing too many arguments.
To fix this issue, be sure to pass the correct number of arguments. At the time of writing, SRANDMEMBER
accepts up to two arguments. Any more than this results in an error.