Method: Redis::Commands::Hashes#mapped_hmset

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

#mapped_hmset(key, hash) ⇒ String

Set one or more hash values.

Examples:

redis.mapped_hmset("hash", { "f1" => "v1", "f2" => "v2" })
  # => "OK"

Parameters:

  • key (String)
  • hash (Hash)

    a non-empty hash with fields mapping to values

Returns:

  • (String)

    "OK"

See Also:



65
66
67
# File 'lib/redis/commands/hashes.rb', line 65

def mapped_hmset(key, hash)
  hmset(key, hash.flatten)
end