module Redis::Commands::SortedSets

def zrandmember(key, count = nil, withscores: false, with_scores: withscores)

Returns:
  • (nil, String, Array, Array<[String, Float]>) -

Parameters:
  • options (Hash) --
  • count (Integer) --
  • key (String) --

Other tags:
    Example: Get multiple random members with scores -
    Example: Get multiple random members -
    Example: Get one random member -
def zrandmember(key, count = nil, withscores: false, with_scores: withscores)
  if with_scores && count.nil?
    raise ArgumentError, "count argument must be specified"
  end
  args = [:zrandmember, key]
  args << count if count
  if with_scores
    args << "WITHSCORES"
    block = FloatifyPairs
  end
  send_command(args, &block)
end