Method: Redis::Commands::Hashes#hmget

Defined in:
lib/redis/commands/hashes.rb

#hmget(key, *fields, &blk) ⇒ Array<String>

Get the values of all the given hash fields.

Examples:

redis.hmget("hash", "f1", "f2")
  # => ["v1", "v2"]

Parameters:

  • key (String)
  • fields (Array<String>)

    array of fields

Returns:

  • (Array<String>)

    an array of values for the specified fields

See Also:


89
90
91
92
# File 'lib/redis/commands/hashes.rb', line 89

def hmget(key, *fields, &blk)
  fields.flatten!(1)
  send_command([:hmget, key].concat(fields), &blk)
end