Redis: Lists Cheat Sheet

Blpop Command

redis 127.0.0.1:6379> BLPOP LIST1 ... LISTN TIMEOUT

Brpop Command

redis 127.0.0.1:6379> BRPOP LIST1 ... LISTN TIMEOUT

Brpoplpush Command

redis 127.0.0.1:6379> BRPOPLPUSH LIST1 ANOTHER_LIST TIMEOUT 

Lindex Command

redis 127.0.0.1:6379> LINDEX KEY_NAME INDEX_POSITION

Linsert Command

redis 127.0.0.1:6379> LINSERT KEY_NAME BEFORE EXISTING_VALUE NEW_VALUE

Llen Command

redis 127.0.0.1:6379> LLEN KEY_NAME

Lpop Command

redis 127.0.0.1:6379> LPOP KEY_NAME

Lpush Command

redis 127.0.0.1:6379> LPUSH KEY_NAME VALUE1.. VALUEN

Lpushx Command

redis 127.0.0.1:6379> LPUSHX KEY_NAME VALUE1.. VALUEN

Lrange Command

redis 127.0.0.1:6379> LRANGE KEY_NAME START END

Lrem Command

redis 127.0.0.1:6379> LREM KEY_NAME COUNT VALUE 

Lset Command

redis 127.0.0.1:6379> LSET KEY_NAME INDEX VALUE

Ltrim Command

redis 127.0.0.1:6379> LTRIM KEY_NAME START STOP

Rpop Command

redis 127.0.0.1:6379> RPOP KEY_NAME

Rpoplpush Command

redis 127.0.0.1:6379> RPOPLPUSH SOURCE_KEY_NAME DESTINATION_KEY_NAME

Rpush Command

redis 127.0.0.1:6379> RPUSH KEY_NAME VALUE1..VALUEN 

Rpushx Command

redis 127.0.0.1:6379> RPUSHX KEY_NAME VALUE1..VALUEN

Leave a Reply

Your email address will not be published.