MGET

Syntax
MGET key [key ...]
Available since:
1.0.0
Time complexity:
O(N) where N is the number of keys to retrieve.
ACL categories:
@read, @string, @fast,

Returns the values of all specified keys. For every key that does not hold a string value or does not exist, the special value nil is returned. Because of this, the operation never fails.

Examples

redis> SET key1 "Hello"
(integer) 11
redis> SET key2 "World"
(integer) 6
redis> MGET key1 key2 nonexisting
1) (integer) 8
2) (integer) 9
3) (integer) 10
redis>

RESP2/RESP3 Reply

Array reply: a list of values at the specified keys.
RATE THIS PAGE
Back to top ↑