MGET

Redis Developer Course Redis Cloud Service Redis-Gate Server

Lookup multiple keys and values

MGET returns the values of all specified keys.   If you specify a key that does not exist in the database, it returns (nil).
Usage is MGET key1 key2.

Return value

Array reply: list of values at the specified keys.

Example

command>mset key1 Hello key2 Redis
result>OK
command>mget key1 key2
result>1) Hello
2) Redis


Syntax

MGET key [key ...]

  • Available since 1.0.0.
  • Time complexity: O(N)
Related Commands GET
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

To practice the command, click here to run Redis Web Client


<< MSET MGET MSETNX >>

Click for a question or to see comments.  Comments :    Viewed :

Email 답글이 올라오면 이메일로 알려드리겠습니다.