LL   (list long format)

Redis 開発者教育
Redis Developer Course
Redis 定期点検/技術支援
Redis Technical Support
Redis エンタープライズサーバ
Redis Enterprise Server

Key를 조회

사용법은 ll 또는 ll pattern 입니다.

Example

명령>ll     아무 옵션이 없으면 모든 key를 조회
결과> 0) type|key|value|last_update_time|expire_time
1) set|myset1|5|[2025-05-07 17:11:45]|[]
2) string|mystr2|value30|[2025-05-07 17:11:29]|[2025-08-15 17:12:38]
3) string|mystr4|value20|[2025-05-07 17:11:29]|[]
4) list|mylist2|5|[2025-05-07 17:11:40]|[]
5) string|mystr3|value50|[2025-05-07 17:11:29]|[]
6) set|myset2|5|[2025-05-07 17:11:51]|[]
7) string|mystr1|value10|[2025-05-07 17:11:29]|[2025-05-17 17:12:32]
8) string|mystr5|value40|[2025-05-07 17:11:29]|[]
9) list|mylist1|5|[2025-05-07 17:11:35]|[]

항목 설명

  • type: 키의 데이터 타입을 보여줍니다. 데이터 타입은 string/list/set/zset/hash/stream 입니다.
  • key: 키를 보여줍니다.
  • value: string일 경우 값(value)를 보여주고, 다른 데이터 타입은 값의 개수를 보여줍니다.
  • last_update_time: 키가 입력된 일시(create time) 또는 마지막 수정 일시(last update time)를 보여줍니다.
    이 항목은 open source 버전에는 없고 Enterprise 버전에서 관리하는 항목입니다.
  • expire_time: expire 명령으로 만료일시가 설정된 경우 만료일시를 보여줍니다.

glob-style pattern을 사용할 수 있습니다.
  • * : 모든 문자 매치(match): h*llo -> hllo, heeeello, etc
  • ? : 1개 문자 매치(match): h?llo -> hallo, hello, hxllo, etc
  • [alphabet] : 대괄호 안에 있는 문자 매치(match): h[ae]llo -> hallo, hello
  • [^e] : 대괄호 안에 있는 문자 제외하고 매치(match): h[^e]llo -> hallo, hbllo, ... 그러나 hello는 제외됨.
  • [a-c] : 대괄호 안에 있는 문자 범위로 매치(match): h[a-c]llo -> hallo, hbllo, hcllo
  • \ : 위에 사용한 특수문자(*?[^])를 그대로 사용하려면 앞에 \를 붙이세요.

Example

명령>ll *   key 조회
결과> 0) type|key|value|last_update_time|expire_time
1) set|myset1|5|[2025-05-07 17:11:45]|[]
...
9) list|mylist1|5|[2025-05-07 17:11:35]|[]
명령>ll myset*   myset로 시작하는 key 조회
결과> 0) type|key|value|last_update_time|expire_time
1) set|myset1|5|[2025-05-07 17:11:45]|[]
2) set|myset2|5|[2025-05-07 17:11:51]|[]

Data type 지정

데이터 타입을 지정해서 해당 키들만 조회할 수 있습니다.
데이터 타입을 지정해서 사용하는 것을 권장합니다.
지정할 수 있는 데이터 타입은 string, list, set, zset, hash, stream 입니다.

Example

명령>ll * list
결과> 0) type|key|value|last_update_time|expire_time
1) list|mylist2|5|[2025-05-07 17:11:40]|[]
2) list|mylist1|5|[2025-05-07 17:11:35]|[]

명령문

LL   [key_pattern]   [string|list|set|zset|hash|stream]   [COUNT count]

  • 이 명령은 Ent 7.5.0 부터 사용할 수 있다.
  • 논리적 처리 소요시간은 O(N)이다. N은 리턴된 키 개수가 아니고 데이터베이스에 있는 모든 키 개수이다.
  • redis.conf ll-max 파라미터로 출력(조회) 제한을 두었습니다.
    키 개수가 ll-max 이상일 경우 다음과 같은 메시지가 나오고 조회되지 않습니다.
    "If the number of keys is greater than ll-max, the 'll' command cannot be executed.
    To execute, modify the 'CONFIG SET ll-max number' command.
    The number of keys can be checked with the 'dbsize' command, and the 'll-max' value can be checked with the 'CONFIG GET ll-max' command."
    'CONFIG SET ll-max number' 명령으로 값을 수정할 수 있습니다.
    운영 서버에서 사용할 경우 'COUNT count' 옵션 사용을 권장합니다.
관련 명령 LS, KEYS

<< LS LL RM >>

Email 返事がかかってなれば、メールでお知らせします。