redis command of ---- List (List)

BLPOP

BRPOP

BRPOPLPUSH

 

LINDEX

LINDEX key index

Back to list  key  , the index for the  index  elements.

Subscript (index) parameter  start  and  stop  are to  0  as a substrate, i.e., to  0  the first element of the list indicates, to  a  second element representing the list, and so forth.

You can also use negative subscripts to  -1  last element of the list indicates,  -2  represent the penultimate element of the list, and so on.

If the  key  is not the type of list, an error is returned.

 

LINSERT

LINSERT key BEFORE|AFTER pivot value

The value of  value  inserted into the list  key  among the values located  pivot  before or after.

When the  pivot  is not present in the list of  key  time, do nothing.

When the  key  is not present,  key  is treated as an empty list, no action.

If the  key  is not the type of list, an error is returned.

 

Fill

LLEN key

Returns a list of  key  length.

If the  key  is not present, then the  key  is interpreted as an empty list, return  0  .

If the  key  is not the type of list, an error is returned.

 

LPOP

LPOP key

Removes and returns a list of  key  head element.

 

LPUSH

LPUSH key value [value ...]

One or more values of  value  inserted into the list  key  table header

If there are multiple  value  value, then the respective  value  value from left to right are sequentially inserted into the header: For example, with an empty list  mylist  Run  LPUSH  mylist  C  , it will be the list of values  A  , this is equivalent to performed on atomically  LPUSH  mylist  A  ,  LPUSH  mylist  B  and  LPUSH  mylist  C  three commands.

If the  key  does not exist, an empty list will be created and executed  LPUSH  operation.

When the  key  is present, but not the type of list, an error is returned.

 

LPUSHX

LPUSHX key value

The value of  value  inserted into the list  key  of the header, and only Dangdang  key  is present and is a list.

And  LPUSH  command Conversely, when the  key  is not present,  LPUSHX  command does nothing.

 

LRANGE

LRANGE key start stop

Returns a list of  key  specified elements in the interval to the interval offsets  start  and  stop  specified.

Subscript (index) parameter  start  and  stop  are to  0  as a substrate, i.e., to  0  the first element of the list indicates, to  a  second element representing the list, and so forth.

You can also use negative subscripts to  -1  last element of the list indicates,  -2  represent the penultimate element of the list, and so on.

 

LREM

LREM key count value

The parameter  count  values, remove list parameter  value  equal elements.

count  value may be the following:

  • COUNT  0  : Header search starting from the end of the table, to remove with  value  equal elements, the number of  COUNT  .
  • count  0  : start the search from the head end of the table to the table, to remove with  value  equal elements, the number of  count  absolute.
  • COUNT  0  : remove all the table  value  equal value.

 

LSET

LSET key index value

The list of  key  subscript  index  set value of the element of  value  .

When the  index  parameter out of range, or an empty list (  Key  not present)  LSET  , it returns an error.

For more information on the subject of the next list, refer to  LINDEX  command.

 

LTrim

 

RPOP

RPOP key

Removes and returns a list of  key  tail elements.

 

RPOPLPUSH

 

Hrifusः

RPUSH key value [value ...]

One or more values of  value  inserted into the list  key  table tail (far right).

If there are multiple  value  value, then the respective  value  value from left to right are sequentially inserted into the end of the table: for example, an empty list  mylist  performed  RPUSH  mylist  C  , to obtain the list of results  C  , the equivalent to command  RPUSH  mylist  A  ,  RPUSH  mylist  B  ,  RPUSH  mylist  C  .

If the  key  does not exist, an empty list will be created and executed  RPUSH  operation.

When the  key  is present, but not the type of list, an error is returned.

 

RPUSHX

RPUSHX key value

The value of  value  inserted into the list  key  table tail, if and only if the  key  is present and is a list.

And  RPUSH  command Conversely, when the  key  is not present,  RPUSHX  command does nothing.

Guess you like

Origin www.cnblogs.com/wuwuyong/p/11701389.html