RPUSHX

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

Push data to the right of the list only if the key already exists

Usage: rpushx key value.

Example

Command>rpush mylist Hello
Result>1
Command>rpushx mylist Redis
Result>2
Command>rpushx mylist2 World   cannot insert into a key that does not exist. Returns 0.
Result>0
Command>exists mylist2
Result>0

View animation



Syntax

RPUSHX key value

  • Available since version 2.2.0.
  • Time complexity is O(1).
Related commands LPUSHX, LPUSH, RPUSH
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

<< LPUSHX RPUSHX BLPOP >>

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