Latest web development tutorials

comando Redis Lpushx

lista Redis (List)

Redis Lpushx irá inserir um ou mais valores para a cabeça de lista existente, não ocorre quando a lista não existe.

gramática

Redis Lpushx sintaxe de comando básica é a seguinte:

redis 127.0.0.1:6379> LPUSHX KEY_NAME VALUE1.. VALUEN

versões disponíveis

> = 2.2.0

Valor de retorno

Depois de comando LPUSHX é executado, o comprimento da lista.

Exemplos

127.0.0.1:6379> LPUSH list1 "foo"
(integer) 1
127.0.0.1:6379> LPUSHX list1 "bar"
(integer) 2
127.0.0.1:6379> LPUSHX list2 "bar"
(integer) 0
127.0.0.1:6379> LRANGE list1 0 -1
1) "bar"
2) "foo"

lista Redis (List)