module Redis::Commands::Hashes

def hrandfield(key, count = nil, withvalues: false, with_values: withvalues)

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

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

Other tags:
    Example: Get multiple random fields with values -
    Example: Get multiple random fields -
    Example: Get one random field -
def hrandfield(key, count = nil, withvalues: false, with_values: withvalues)
  if with_values && count.nil?
    raise ArgumentError, "count argument must be specified"
  end
  args = [:hrandfield, key]
  args << count if count
  args << "WITHVALUES" if with_values
  parser = Pairify if with_values
  send_command(args, &parser)
end