Method: Redis::Commands::Strings#mget

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

#mget(*keys, &blk) ⇒ Array<String>

Get the values of all the given keys.

Examples:

redis.mget("key1", "key2")
  # => ["v1", "v2"]

Parameters:

  • keys (Array<String>)

Returns:

  • (Array<String>)

    an array of values for the specified keys

See Also:



204
205
206
207
# File 'lib/redis/commands/strings.rb', line 204

def mget(*keys, &blk)
  keys.flatten!(1)
  send_command([:mget, *keys], &blk)
end