English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis Mget command returns the values of all (one or more) given keys. If any of the given keys do not exist within the given key, then that key returns a special value nil.
The basic syntax of the redis Mget command is as follows:
redis 127.0.0.1:6379> MGET KEY1 KEY2 .. KEYN
>= 1.0.0
A list of all the values associated with the given keys.
redis 127.0.0.1:6379> SET key1 "hello" OK redis 127.0.0.1:6379> SET key2 "world" OK redis 127.0.0.1:6379> MGET key1 key2 someOtherKey 1) "Hello" 2) "World" 3) (nil)